[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: call/cc
You write:
> > FORTH: marker foo 3 5 :noname + ; execute foo
> > 9 tokens (explicit cleanup)
> > FORTH: 3 5 :noname + ; execute 6 tokens (cheating because no GC)
> > PostScript: 3 5 {add} exec 6 tokens
> > dc: 3 5 [+] x 6 tokens
>
> i don't agree with the FORTH, PostScript and dc version since the addition is
> used a simple function.
>
> or you must allow:
>
> OCaml: (+) 3 5 5 tokens
> Haskell: (+) 3 5 5 tokens
No, the FORTH, PostScript, and dc versions of that are 3 5 +, 3 5 add,
and 3 5+, respectively. All three of them are, in fact, creating a
new anonymous function of two arguments which applies the language's
primitive addition operator to them and returns its result. It's just
that in stack-based languages, you don't have to name either your
formal parameters or your actual parameters.