Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue parsing floats #34

Open
ahumenberger opened this issue Oct 28, 2019 · 1 comment
Open

Issue parsing floats #34

ahumenberger opened this issue Oct 28, 2019 · 1 comment

Comments

@ahumenberger
Copy link

When setting a float value I'm getting the following error:

julia> lisp"(def x 2.5)"
ERROR: LoadError: Malformed def: Length of list must be == 3
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] codegen(::Array{Any,1}) at /Users/ahumenberger/.julia/packages/LispSyntax/ykFIL/src/LispSyntax.jl:91
 [3] lisp_eval_helper(::String) at /Users/ahumenberger/.julia/packages/LispSyntax/ykFIL/src/LispSyntax.jl:154
 [4] @lisp_str(::LineNumberNode, ::Module, ::Any) at /Users/ahumenberger/.julia/packages/LispSyntax/ykFIL/src/LispSyntax.jl:158
in expression starting at REPL[3]:1

which might be because of

julia> LispSyntax.read("(2.5)")
LispSyntax.s_expr(Any[2, Symbol(".5")])
@TheodoreEhrenborg
Copy link

This works:

julia> lisp"(def x 2.5d)"
2.5

Alternatively append f to get it parsed as a Float32; see https://github.com/swadey/LispSyntax.jl/blob/master/src/parser.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants