#lisp - Sat 5 May 2007 between 00:25 and 04:03

NY Lost Funds



slyrusevening
tritchey_evening slyrus
kwertiiIs it a bad idea to write a macro that macroexpands CCASE and substitutes EQUAL for every instance of EQL as a way of getting a CCASE that works on strings?
I'm thinking some implementations might use EQL somewhere besides the direct comparisons I'm interested in. Is that likely to be a problem?
froydnj"somewhere besides the direct comparisons"?
actionfroydnj slams his encoding changes
froydnjslams his encoding changes
kwertiifroydnj: Looking at the macroexpand of ccase on SBCL, it only uses EQL when comparing the forms. But there's other boilerplate code to construct the error message. I can imagine some other implementation might use EQL in there.
alastair37why are you macroexpanding ccase and not writing your own separate macro that's distinct from ccase?
(which just does similar things to ccase)
kwertiialastair37: To avoid duplicating the functionality of ccase, if I can
alastair37i think i'd rather duplicate a bit of functionality than worry about deep eql vs. equal issues.
kwertiialastair37: that's probably best ...
alastair37i mean, you don't lose any efficiency, and it makes things clearer and more under your control.
msinghhm is there a nice way to do this: "a bc d e f" -> ("a" "bc" "d" "e" "f")
slyrusyes, it is odd that they lift things like regular expressions to the library developer but included a nifty roman numeral printing facility in the CL standard.
alastair37msingh: (mapcar #'symbol-name (read-from-string <your-string>))
not direct, but certainly concise.
probably causes some overhead from reading and interning the symbols, if they aren't already in the current package.
but in 99.99% of cases, you don't care
kwertiimsingh: cl-utilities includes a split-sequence function that does that: http://common-lisp.net/project/cl-utilities/doc/split-sequence.html
alastair37whoops; need to append parens at the beginning and end of your string.
little mental flatulence.
msinghalastair37, ah thats no good. i want to avoid brackets in my little interpreter
alastair37no, you'd append them in the function
as in: (mapcar #'symbol-name (read-from-string (concatenate 'string "(" your-string ")")))
that works; i just tested it.
msinghwhat did you test with?
alastair37(mapcar #'symbol-name (read-from-string (concatenate 'string "(" "a bc d" ")")))
=> ("A" "BC" "D")
good?
msinghsweet.. that looks good
yeah. thanks.
beachgood morning
slyrusmorning beach
ah. ya gotta love latex: "\z@ is shorthand for 0pt"
cuz, ya know, typing \z@ is so much easier than typing 0pt
asbjxrn\z@ inserts 0pt in the text, or sets the text size to 0pt?
slyrusI assume the former
beachis that LaTeX, or was it inherited from TeX?
slyruswho knows. tex, latex, a bazillion latex packages, etc... makes lisp look downright clean.

Page: 2 9 16 

IrcArchive

NY Lost Funds