3 ms·
I think the OP is referring to the pseudo-variables, true, false, nil, self, super, and thisContext: https://en.wikipedia.org/wiki/Smalltalk#Syntax https://en.
by MonkeyClub 4y ago
I think the OP is referring to the pseudo-variables, true, false, nil, self, super, and thisContext:
https://en.wikipedia.org/wiki/Smalltalk#Syntax https://en.wikipedia.org/wiki/Smalltalk#Syntax
I don’t think they count.
If we’re counting small numbers, Lisp also has a small number of “keywords”, nine:
quote atom eq
cons car cdr
lambda label define
Others put this number at five or seven. I guess you can express define as a function of label and lambda, so you drop to eight, but I don’t know how you get to seven, let alone five.
- zelphirkalt 4y agoNot sure how Smalltalk measures up in that regard, but wouldn't one also need to count things like define-syntax and all things, which are built-in for defining macros? I guess that would only be fair, because that gets Lisps up to the same power level as Smalltalk with its introspection and ability to create classes at runtime, since they are objects as well. Then there are things like "What is the syntax for a vector?" and all kinds of reader syntax with "# + something", depending on the dialect/specific lisp language, I guess. EDIT: Found this: https://wiki.c2.com/?SmalltalkSyntaxInaPostcard https://wiki.c2.com/?SmalltalkSyntaxInaPostcard
- mtlmtlmtlmtl 4y agoCons, car and cdr can be defined in terms of lambda, though it's not exactly an efficient implementation: (define (cons x y) (lambda (f) (f x y))) (define (car c) (c (lambda (x y) x))) (define (cdr c) (c (lambda (x y) y)))
- MonkeyClub 4y agoEfficient or not, it's very pretty, I love its self-referential house-of-cardiness :)
- MonkeyClub 4y agoGah, silly me -- I forgot 'cond'! Just throw that into the list, and ditch define.