Skip to content

04. Parameters

Tom Dodd edited this page Dec 11, 2023 · 5 revisions

In DSSL, the nth argument of an m-parameter keyword or function is defined as the element (m - n) positions away from the top of the stack. For example, the roll keyword, which cycles elements on the stack, requires two arguments:

3  # first argument (number of elements to roll)
1  # second argument (number of positions to roll by)
roll

Keywords and functions will always pop a fixed number of arguments from the stack, with the exceptions of class definitions and potentially native method calls. Member accesses will also pop the accessed element as if it were an "argument" of the access.

Clone this wiki locally