Skip to content

CodeTracking does not find function unless in another package? #133

@co1emi11er2

Description

@co1emi11er2

I have this package I made called Handcalcs which uses this package to "unroll" functions. See here. This has been pretty great to use although I am hoping to get it working for when functions are defined in the current scope.

Say I have this script:

using CodeTracking

function my_add(a, b)
    c = a + b
end

f = @code_expr my_add(3, 4)

println(f)

d = @which my_add(3, 4)

println(d)

The output I get is:

nothing 
my_add(a, b) @ Main c:\Users\c-mil\jlcode\codetracking\codetrack.jl:3

So the @code_expr macro fails to find the function just defined, but the @which macro is able to. Is there a way to get this working? I could try and implement it if you think there is a way. I think this could also fix the jupyter issue (#51) as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions