4 ms·
I played with python-lisp for some time and decided that python-array is not a LIST but CONS. And if the python-array has more than two pieces, it can be pretty
by timonoko 4y ago
I played with python-lisp for some time and decided that python-array
is not a LIST but CONS. And if the python-array has more than two
pieces, it can be pretty-printed as an ARRAY. Haters will hate, but
this is the Ultimate Solution.
> '[1, 2, 3]
[1, 2, 3]
> '(1 2 3)
(1 2 3)
> '[1, 2]
(1 . 2 )
> '[1,(2 3)]
(1 2 3)
https://github.com/timonoko/nokolis.py https://github.com/timonoko/nokolis.py
- lioeters 4y ago> Nokolisp had no strings, but I invented new practise: a flat list of numbers with first number as 34, is prettyprinted as string in the editor. Then you can edit the numberlist normally and the editor shows range(32,256) as chracters alongsside. Interesting solution! I wasn't sure if you were joking, but I see this syntax/convention is actually used. (print-nice (34 100 101 102 113 40 39)) Is there a way to escape the first number if there's a need to create a list with a literal 34?
- timonoko 4y agoNot much need for that. But I would now change the rule so that the number-list must have 34 at both ends. It is little illogical and ugly that there is only one 34 but two quotation marks is prettyprinted. > '(34 72 101 108 108 111) "Hello"