h3rald / min

A small but practical concatenative programming language and shell
https://min-lang.org
MIT License
309 stars 23 forks source link

`(dup *) square define` -> Undefined symbol 'square' #3

Closed enthus1ast closed 7 years ago

enthus1ast commented 7 years ago

at https://min-lang.org/learn-operators/

z@z ~/min> ./min -i
[/home/z/min]$ 1
{1} -> 1
[/home/z/min]$ 2
{2} -> 2
[/home/z/min]$ (dup *) square define
(!) <repl>(1,14) [square]: Undefined symbol 'square'
    <repl>(1,14) in symbol: square
[/home/z/min]$ 
enthus1ast commented 7 years ago

(dup *) 'square define ?

h3rald commented 7 years ago

Yep... right, any of the following:

(dup *) 'square define

or

(dup *) "square" define

...of course probably once you get the hang of sigils you'd probably go for just:

(dup *) :square

I'll fix it right now, thanks for spotting this!