How do variable names work in LLL?

nejucomonejucomo Member Posts: 40
I've just read and looked at examples in but I am confused about variable names. The first page says:

Any otherwise undefined text strings are assumed to be variable definitions, thus a for loop to count between 0 to 9 looks something like:

(for [i]:0 (< @i 10) [i](+ @i 1)
;; do something

The code example makes 'i' seem like an expression which is used for indexing memory. What does it evaluate to? What if I need K bytes of memory, how can I ensure I won't clobber any variables?

Two other quick questions:

Where is the compiler for LLL? I've found serpent, but not the LLL compiler.

An example shows:

@(calldataload 0)

What is the ':' here? It is not mentioned in the LLL-PoC-5 spec.

Best Answer


  • mode80mode80 Member Posts: 64 ✭✭
    The colon is undocumented, but it's just whitespace far as I can tell. I think it helps with readability when using the shortcut [slot]:value notation in place of (mstore slot value)
Sign In or Register to comment.