Name: Anonymous 2015-10-09 21:19
how the fuck do I use define-syntax and syntax-rules to convert
ANSWER ME THAT, MATH BOYS
"abc"
into (string->list "abc")
?ANSWER ME THAT, MATH BOYS
"abc"
into (string->list "abc")
?shitface
that turns "abc"
into (string->list "abc")
"abc"
and shitface
sees that and dutifully turns it into (string->list "abc")
(string->list "abc")
that contains "abc"
and shitface
sees that and dutifully turns it into (string->list (string->list "abc"))
(string->list (string->list "abc"))
that contains "abc"
and shitface
sees that and dutifully turns it into (string->list (string->list (string->list "abc")))
define-syntax and syntax-rulesWhat do they have to do with Lisp macros anyway?
(defmacro (to-list a)
`(coerce ,a 'list))
string-
functions". "abc"
to (string->list "abc")
using a reader macro, you stupid fucks. anti-satoricalMy new favorite word.
they are arrays.Not if you plan to support utf8, the one true encoding. Strings are no longer a list of bytes which can easily be indexed in an array, but a list of variable-length codepoints, which can take up to O(N) time to access. It doesn't matter whether characters are stored in a linked list or an array now, they have the same O() for indexing.
There are other ways, like using 32-bit codepoints and using the extra values for composite characters a la Perl 6.How does it work? There's an unlimited number of possible composing characters and only 11 free bits in a 32bit codepoint.