Macros |
✓ |
; A macro is essentially a function that generates code. I would have
; liked the first example of a macro to be something simpler, but fn
; is the one we need first. So I'll introduce macros using a simpler
; macro that isn't part of Bel, then explain fn.
; Here is a very simple macro:
(mac nilwith (x)
(list 'cons nil x)) |
|
Strings |
✓ |
(\h \e \l \l \o)
; can also be represented as
"hello" |
|
Booleans |
✓ |
; The symbol nil represents falsity as well as the empty list.
; The symbol t is the default representation for truth, but any object other than nil also counts as true. |
|
Functions |
✓ |
(fn (x) (+ x 1)) |
|
Expressions |
✓ |
(+ 1 2) |
|
Streams |
✓ |
|
|
Lists |
✓ |
; here is a list of a, b, and c:
(a . (b . (c . nil)))
; can be written as
(a b c) |
|
Characters |
✓ |
\p
; Characters that aren't letters may have longer names. For example the bell character, after which Bel is named, is
\bel |
|
hasSymbols |
✓ |
foo |
|
Pairs |
✓ |
(foo . bar) |
|
Print() Debugging |
✓ |
|
prn |
Comments |
✓ |
; A comment |
|
Line Comments |
✓ |
; A comment |
; |
Semantic Indentation |
X |
|
|
Case Insensitive Identifiers |
X |
|
|