dysonance / Strategems.jl

Quantitative systematic trading strategy development and backtesting in Julia
Other
162 stars 38 forks source link

"LoadError: syntax: "..." expression outside call" #21

Closed gruberdev closed 5 years ago

gruberdev commented 6 years ago

I've installed and then reinstalled Julia 0.7.0v from the official site, made a clean git from the latest pull from the author, then, proceeded to run the examples/mama.jl and the test/runtest.jl, both didn't sucessfully compile and gave me the following stack:

**ERROR: LoadError: LoadError: syntax: "..." expression outside call**
Stacktrace:
 [1] include at .\boot.jl:317 [inlined]
 [2] include_relative(::Module, ::String) at .\loading.jl:1038
 [3] include at .\sysimg.jl:29 [inlined]
 [4] include(::String) at C:\Users\MyUser\.julia\packages\Strategems\PJiUR\src\Strategems.jl:3
 [5] top-level scope at none:0
 [6] include at .\boot.jl:317 [inlined]
 [7] include_relative(::Module, ::String) at .\loading.jl:1038
 [8] include(::Module, ::String) at .\sysimg.jl:29
 [9] top-level scope at none:2
 [10] eval at .\boot.jl:319 [inlined]
 [11] eval(::Expr) at .\client.jl:399
 [12] top-level scope at .\none:3
in expression starting at C:\Users\MyUser\.julia\packages\Strategems\PJiUR\src\rule.jl:15
in expression starting at C:\Users\MyUser\.julia\packages\Strategems\PJiUR\src\Strategems.jl:34
ERROR: LoadError: Failed to precompile Strategems [054b7d4e-9922-5ad3-8b46-7dbe695a681f] to C:\Users\laughing man\.julia\compiled\v0.7\Strategems\qq9u1.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] macro expansion at .\logging.jl:313 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1185
 [4] _require(::Base.PkgId) at .\logging.jl:311
 [5] require(::Base.PkgId) at .\loading.jl:852
 [6] macro expansion at .\logging.jl:311 [inlined]
 [7] require(::Module, ::Symbol) at .\loading.jl:834
 [8] include at .\boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at .\loading.jl:1038
 [10] include(::Module, ::String) at .\sysimg.jl:29
 [11] exec_options(::Base.JLOptions) at .\client.jl:239
 [12] _start() at .\client.jl:432
in expression starting at C:\User\MyUser\Documents\Strategems.jl\examples\mama.jl:1

Which leads us again to:

macro rule(logic::Expr, args...)
    trigger = :($(logic.args[2]))
    #action = :($(logic.args[3])$((args...)))
    action = :($(logic.args[3]))
    args = :($(args))
    return esc(:(Rule($trigger, $action, $args)))
end

I have a vague idea on how to fix the code, but since it's a default error, I thought I'd report as an issue.

dysonance commented 5 years ago

@VerifiedGruber Thanks for the heads up about this problem. Try pulling from master again and rerunning. It works for me now on Julia v1.0 and v0.7.

I'm working on adding examples to the test cases as well.

dysonance commented 5 years ago

@VerifiedGruber This has now been incorporated into the test cases and is passing for the above versions of Julia. Will draft a release to get this published Julia's package manager. In the meantime, pulling from master should have this working for you. Going to close this now, let me know if you continue experiencing the issue and we can happily reopen this and figure out how to get it fixed for you.