IRC channel logs

2023-02-20.log

back to list of logs

<daviid`>cow_2001: not sure what are you compalaining about 'exactly', this is perfectly described in the manual
<daviid`>cow_2001: '(module-ref (current-module) 'f)' raises an exception ... the call should be (module-ref (resolve-module <the-module-where-f-is-defined>) 'f) ...
<cow_2001>i found a predicate that handles it, so it's fine
<cow_2001>(i still don't know how to handle exceptions)
<daviid`>cow_2001: well, you should not have any exception
<daviid`>cow_2001: but you can catch those 'you do not control', such as encoding for examnple, then proceed ... i think there is a hello world example which tries to set port encoding and uses catch to catch the 'possible' exception ...
<chrislck>sneek: botsnack
<sneek>:)
<daviid`>cow_2001: here is a tiny example (catch #t (lambda () (module-ref (current-module) 'foo)) (lambda args (pk 'undefined-foo) #f))
<cow_2001>daviid`: thank you
<daviid`>welcome
<yewscion>Hello all, what is the canonical way to give a name to a procedure returned from another procedure? If (foo) returns a procedure, and I want to refer to that procedure using the symbol 'bar, I can execute (define bar (foo))… but if I do that, the hinting system in Geiser doesn't show the arguments that the procedure expects (it just shows the name of a procedure and the … indicating the rest of the arguments). Is
<yewscion>there another way I should be doing that?
<lilyp>yewsicon: you could do (define (bar x y z) ((foo) x y z)) but other than that you are limited to what (foo) gives you
<yewscion>Ah! That was the syntax I was missing, thank You!
<yewscion>lilyp: That's not considered bad form, is it? The double-parens there makes me think it might be; I haven't seen them before.
<lilyp>Well, written like this it's somewhat unusual, but directly calling a function returned from a function is very legal Scheme.