Skip to content

feat(chisel): get last result and assign #5370

Open
@radeksvarz

Description

@radeksvarz

Component

Chisel

Describe the feature you would like

It is common that REPL environments have the approach to access the last result (Python having "_", Chrome console having "$_")

It would be ideal if chisel also had that, e.g.:

➜ type(uint256).max
Type: uint
├ Hex: 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
└ Decimal: 115792089237316195423570985008687907853269984665640564039457584007913129639935
➜ uint256 MAX = $_

Ideally such feature would be implemented in the similar way IPython has that:

Input and output history are kept in variables called In and Out, keyed by the prompt numbers, e.g. In[4]. The last three objects in output history are also kept in variables named _, __ and ___.
https://ipython.readthedocs.io/en/stable/interactive/tutorial.html#history

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions