IDP-Lua does not accept "= #L" as command after "L = {}"

Issue #219 wontfix
Broes De Cat created an issue

This is an allowed command in lua.

Comments (4)

  1. Stef De Pooter

    Relevant piece of info from Lua website: http://lua-users.org/wiki/InteractiveLua

    However, there are some limitations about the standard interactive prompt; if you wish to evaluate an expression, you must prefix it with '='. The interpreter translates this as 'return ' so that you are always entering a valid chunk of Lua code. Also, tables are not printed out, unless there is an explicit __tostring in their metatables:

    $ lua
    Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
    > = 10+20
    30
    > t = {10,20,30}
    > = t
    table: 003DB790
    
  2. Stef De Pooter

    So, this '=' is a feature of lua interpreter for evaluating expressions and returning the result.

    The thing is that our interactive mode does not return results. You can make it return stuff by using prints, but it does not return the result of evaluating the command you gave.

    Is this what we want?

  3. Log in to comment