Giter Club home page Giter Club logo

exfiltrator.jl's Introduction

THIS PACKAGE IS NOT MAINTAINED

Similar functionality has been implemented in Infiltrator.jl. Please use that package instead of Exfiltrator.jl.

Exfiltrator

Build Status

Exfiltrator is the reverse of Infiltrator.jl. It allows you to "exfiltrate" local variables from a function into the global scope.

using Exfiltrator

julia> function f(x)
           @exfiltrate
       end
f (generic function with 1 method)

julia> f(2)

julia> x
2

Also supported are @exfiltrate VAR, which exfiltrates the local variables to the global variable VAR as a named tuple, @exfiltrate VAR x, which exfiltrates only x, and the @exfiltrate_push! ARR and @exfiltrate_push! ARR x which push the exfiltrated variables to a global array.

You can avoid typing using Exfiltrator by using it at the REPL and then using Main.@exfiltrate in your code.

exfiltrator.jl's People

Contributors

antoine-levitt avatar cstjean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cstjean

exfiltrator.jl's Issues

Doesn't protect symbols properly

here is a bug I just found.

julia> function foo()
       t = :doesnt_exist
       @exfiltrate
       end
foo (generic function with 1 method)

julia> foo()
ERROR: UndefVarError: doesnt_exist not defined
Stacktrace:
 [1] top-level scope at none:1
 [2] eval at ./boot.jl:331 [inlined]
 [3] eval(::Expr) at ./client.jl:467
 [4] setfield!!(::Module, ::Symbol, ::Symbol) at /home/peterwd/.julia/packages/Exfiltrator/3rhI7/src/Exfiltrator.jl:5
 [5] macro expansion at /home/peterwd/.julia/packages/Exfiltrator/3rhI7/src/Exfiltrator.jl:9 [inlined]
 [6] foo() at ./REPL[62]:3
 [7] top-level scope at REPL[63]:1

`@exfiltrate VARS` doesn't work inside module/package

Thank you for Exfiltrator! This package is beautiful and is making debugging Julia so much easier for me. I have encountered a problem though that where as the basic Main.@exfiltrate works fine from within package functions, the expanded syntax Main.@exfiltrate VARS doesn't seem to do anything. It does work fine in test functions outside of a package.

Here's an example where it does nothing:

using Exfiltrator

module MyMod

function f(x)
    Main.@exfiltrate vars
    2x
end

end

MyMod.f(1)

And then there is no vars in the Main workspace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.