Skip to content

Tutorial: Magic Dot

molarmanful edited this page Nov 28, 2023 · 6 revisions

The . in sclin is rather versatile in that its behavior depends on what it precedes. Here are the rules:

Ending a Line

Synonymous with ; - executes the next line.

1 1+.
2 3*
-> 2 6

Before another .

Executes the next line, ignoring the rest of the line. Useful for post-line commenting.

1 1+.. this is a comment
2 3*

Before a CMD

Takes the top of the stack and pairs it with the command to create an FN.

1.+
-> (1 +)
[1 2 3] 2.*.map Q
-> [1 2 3] [2 4 6]

Before an STR

Processes the string's escapes.

"asdf\n1234"n>o ."asdf\n1234"n>o
-> asdf\n1234
asdf
1234

Otherwise

Pushes to the stack.