Skip to content

REPL hook-related issues #101

@topolarity

Description

@topolarity

I'm starting to use JL in the REPL via @mlechu's experimental JULIA_USE_FLISP_LOWERING=0 hook.

This is a catch-all issue to document any issues I encounter:

  1. defining functions prints an anonymized name and seems to be the typeof(f) instead of f:
    julia> foo(x,y) = (x = y + y; x)
    #foo##0 (generic function with 1 method)
    
    julia> var"#foo##0"(1,2)
    ERROR: MethodError: no method matching var"#foo##0"(::Int64, ::Int64)
    
    julia> var"#foo##0".instance(1,2)
    4
  2. const x = ... does not work:
    julia> const x = 3
    ┌ Info: JuliaLowering threw given input:
    │   code =quote$(Expr(:softscope, true))
    │        const x = 3end
    │   st0 =
    │    SyntaxTree with attributes kind,var_id,toplevel_pure,scope_type,name_val,syntax_flags,meta,scope_layer,value,is_toplevel_thunk,source
    │    [scope_block]                                                │ scope_type
    │      [const]                                                    │
    │        [=]                                                      │
    │          x                                  :: Identifier       │
    │          3                                  :: Integer          │
    │
    │   file = "REPL[7]"
    │   line = 1
    └   mod = Main
    ERROR: LoweringError:
    #= REPL[7]:1 =# - unsupported `const` declaration on local variable
  3. non-global top-level assignments do not work:
    julia> y = 13
    13
    julia> y
    ERROR: UndefVarError: `y` not defined in `Main`
    Suggestion: check for spelling errors or missing imports.

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