libera/#commonlisp - IRC Chatlog
Search
11:55:26
Inline
when i do stuff interactively i see changes otherwise when i load from files then not
11:59:03
tfb
I'm not sure what you're doing to break it, but it should be fine (there are other problems like the in-package which makes no sense) but it does work
12:23:07
tfb
Inline: but note *readtable* (and *package*) is bound by load so you need to set the readtable later. *print-pretty* etc *isn't* so bound however so if you're not seeing changes in those, you're doing something odd
18:00:35
jcowan
phoe: You can write a very short function to do "1st"-style formatting for you: take the number mod 10, then convert the number to a string. if the modulo result is {1,2,3}, append {st,nd,rd}, otherwise append "th'.
18:03:19
jcowan
and 12th and 13th, yes. So it may be simpler to work with mod 100 and a vector of strings.
18:24:41
pjb
(format nil "~{~D~:*~[th~;st~;nd~;rd~:;th~]~^, ~}" (iota 10)) #| --> "0th, 1st, 2nd, 3rd, 4th, 5th, 6th, 7th, 8th, 9th" |#
18:26:26
pjb
(format nil "~:{~D~[th~;st~;nd~;rd~:;th~], ~}" (mapcar (lambda (n) (list n (if (< 10 n 20) 5 (mod n 10)))) (iota 35))) #| --> "0th, 1st, 2nd, 3rd, 4th, 5th, 6th, 7th, 8th, 9th, 10th, 11th, 12th, 13th, 14th, 15th, 16th, 17th, 18th, 19th, 20th, 21st, 22nd, 23rd, 24th, 25th, 26th, 27th, 28th, 29th, 30th, 31st, 32nd, 33rd, 34th, " |#