|
|
|
|
|
by e12e
2437 days ago
|
|
Am I reading that right, that: (2 '(a b c))
Is equivalent to: (second '(a b c))
And that would work for strings as well: (5 "Hello, world!")
> "o"
Which in turn means 'car and' 1 are equivalent? (probably means 'car should be thrown out, because surely '1 is clearer?Ed: and with some notation to differenciate "element at N" and "tail behind N" you could get even more mileage out of integers? And then to generalize to lists of lists to reference elements and sub-sections (sub dimensions, like cubes) of matrices? Not sure what would be nice, perhaps star or ellipsis? (1... '(a b c))
>'(b c)
('(1..) '(0..2)
'(
(a b c)
(d e f))
>'(
(b c)
(d f))
Or something? |
|