The Little PHPer - 1. Toys
Scheme | PHP [Source Code] |
---|---|
atom | non-array [1] |
atom (quote atom)
|
'atom'
|
1492
|
1492
|
*abc$
|
'*abc$'
|
list [2] | array [3] |
(atom) (quote (atom))
|
['atom']
|
(atom turkey or)
|
['atom', 'turkey', 'or']
|
((atom, turkey) or)
|
[['atom', 'turkey'], 'or']
|
(((how) are) ((you) (doing so)) far)
|
[[['how'], 'are'] [['you'], ['doing', 'so']], 'far']
|
()
|
[]
|
(() () ())
|
[[], [], []]
|
car
|
|
cdr [4]
|
|
cons
|
|
null?
|
|
atom?
|
|
eq?
|
- PHP Types.
- S-expression.
- PHP Array,
treated as an array
. - Why Car and Cdr?