@ksaj
(defun worst-r-dereader (s c n) (declare (ignore c))
"(list #1rten #2rtenth #rx )"
`(loop :with num := (symbol-name ',(read s t t t))
:for x :from 1
:below most-positive-fixnum
:for rom :=
(format
nil
(cond
((and ,n (= ,n 1)) "~:@(~r~)")
((and ,n (= ,n 2)) "~:@(~:r~)")
((null ,n) "~@r")
(:otherwise (error "Unknown number type")))
x)
:when (string= num rom) :return x))
(set-dispatch-macro-character #\# #\r #'worst-r-dereader)
I guess we can't write #oxiii ;_;
@phoe
Notices by screwlisp (screwtape@mastodon.sdf.org), page 4
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 09:05:08 JST screwlisp
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 08:43:17 JST screwlisp
@ksaj @phoe
So there are only these special cases:
(format t "~b" #b10) = (format t "~2r" #b10)
(format t "~o" #o10) = (format t "~8r" #o10)
(format t "~x" #x10) = (format t "~16r" #x10)
If you want base 3, as we often do, we're stuck with just
(format t "~3r" 3) -
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 08:40:58 JST screwlisp
@ksaj
We can run an arbitrary function in format:
(defun new-thing (stream arg colonp atsignp))
(format t "~/new-thing/" 'foo)
but I'm not quite sure what we would want it to do. Also, only the natural bases have their own format directives, the rest just get shoed into ~r along with base ten noun and adjective wordses and roman numerals.
@phoe @r -
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 08:32:17 JST screwlisp
@phoe @ksaj
If we mean (setq *print-base* :roman) instead of (setq *print-base* #o10) I'm out of my depth ;p -
Embed this notice
Michał "phoe" Herda (phoe@functional.cafe)'s status on Thursday, 23-Jan-2025 08:26:20 JST Michał "phoe" Herda
@ksaj @screwtape Doing means that you can no longer have a symbols named I, V, X, M, and so on. It would suck if you could no longer (LOOP FOR I BELOW 100) because that would be equivalent to (LOOP FOR 1 BELOW 100) which is invalid.
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 08:27:24 JST screwlisp
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 08:26:19 JST screwlisp
@phoe @ksaj
I swear I saw this somewhere else, and please do not consider it my original work ;p :
CL-USER>
(defun worst-roman-reader (s c n) (declare (ignore c n))
`(loop :with num := (symbol-name ',(read s t t t))
:for x :from 1
:below most-positive-fixnum
:for rom := (format nil "~@r" x)
:when (string= num rom) :return x)
)
WORST-ROMAN-READER
CL-USER> (set-dispatch-macro-character #\# #\r #'worst-roman-reader)
T
CL-USER> #RCCLV
255 -
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 08:03:56 JST screwlisp
@ksaj @phoe I think ksaj probably meant these actually:
CL-USER> (format t "~o" #xFF)
377
NIL
CL-USER> (format t "~x" #o377)
FF
NIL
CL-USER> (format t "~@r" #o377)
CCLV
NILso I'm going to say because ~r is choose-your-own-base radix, with @r being roman numerals. Not like binary, hex and octal which have special readers as well as format directives.
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 08:00:27 JST screwlisp
@ksaj I look forward to your roman numeral read macro.
CL-USER> (format t "~16r" #o10)
8
NIL
CL-USER> (format t "~8r" #x10)
20
NIL
CL-USER> (format t "~@r" #o10)
VIII
NIL -
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 05:28:59 JST screwlisp
@shizamura
Yeah,Straight from the stands to your feed ⚽🔥 All the goals, beefs, and bangers that matter. No fluff, just footy – real, raw, relentless.
follows me on the mastodon. I like to think they're a malware author still powered by tinyscheme lisp (famous javascript malware), and so they unironically listen to the show.
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 05:08:16 JST screwlisp
@dougmerritt
CL-USER> '(#:foo #:bar #:cursor #:baz)
(#:FOO #:BAR #:CURSOR #:BAZ)
CL-USER> (cdr *)
(#:BAR #:CURSOR #:BAZ)
CL-USER> (search * **)
1
in the first place to find cursors that are just specific conses - no need for named symbols
@kentpitman @ksaj @TheGibson @mdhughes @baruchel @nosrednayduj @ratxue @hairylarry -
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 23-Jan-2025 05:07:12 JST screwlisp
@dougmerritt
Thanks and thanks for your advice on cursors in NUD. I had been imagining doing this to find cursors:
CL-USER> '(#:foo #:bar #:cursor #:baz)
(#:FOO #:BAR #:CURSOR #:BAZ)
CL-USER> (find 'cursor * :key 'symbol-name :Test 'string=)
#CURSOR
perhaps with multiple uninterned cursors, which is why I had the funny cursor symbols actually swapping their way through conses but then I realised I can just do
@kentpitman @ksaj @TheGibson @mdhughes @baruchel @nosrednayduj @ratxue @hairylarry -
Embed this notice
Lars Brinkhoff (larsbrinkhoff@mastodon.sdf.org)'s status on Wednesday, 22-Jan-2025 16:09:19 JST Lars Brinkhoff
@screwtape @amszmidt That could well be. I haven't followed Emacs closely; is compilation to machine code in yet?
-
Embed this notice
Karsten Johansson (ksaj@infosec.exchange)'s status on Thursday, 23-Jan-2025 04:41:59 JST Karsten Johansson
@TheGibson @screwtape @mdhughes @baruchel @nosrednayduj @hairylarry Hah silly me... I always thought your screen name was about a certain mythological computer!
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Wednesday, 22-Jan-2025 15:13:50 JST screwlisp
@larsbrinkhoff
My memory says that compilation of elisp significantly around emacs 24, but listen, today hasn't been my best day
@amszmidt -
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Wednesday, 22-Jan-2025 14:06:58 JST screwlisp
@stargazersmith s/can/if they were left alone would be able to/
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Wednesday, 22-Jan-2025 13:01:21 JST screwlisp
ah, the episode really was not as coherent as one might hope
@kentpitman @ksaj @TheGibson @mdhughes @baruchel @nosrednayduj @ratxue @hairylarry
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Wednesday, 22-Jan-2025 12:30:12 JST screwlisp
@TheGibson
Oh sorry, I misread what you said as being a response to Ksaj's country album, The Sinister Love Affair he shared when you called for everyone to get in a circle!
I didn't check if the ipv4 veilid on openbsd got a patch submitted, but after that sometime I hope we can have your guitar (better audio balanced than my attempt here)
@ksaj @mdhughes @baruchel @nosrednayduj @hairylarry -
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Wednesday, 22-Jan-2025 12:25:23 JST screwlisp
-
Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Wednesday, 22-Jan-2025 10:02:58 JST screwlisp
Thanks everyone! Sorry for the disaster episode. And we didn't get to the book club; next week when yduJ is back, I guess!
@kentpitman @ksaj @TheGibson @mdhughes @baruchel @nosrednayduj @ratxue @hairylarry