IRC channel logs

2021-04-20.log

back to list of logs

<manumanumanu>Ahoy!
***rekado_ is now known as rekado
<wingo>moin :)
<rgherdt_>Moin!
***rgherdt_ is now known as rgherdt
<manumanumanu>Anyone here on 3.0.5?
<manumanumanu>can anyone tell me when I can have definitions in expression context? It doesn't seem to be allowed in cond clauses.
<terpri>manumanumanu, i'm on 3.0.5 and it appears to be permitted
<terpri>let me check cond in case 'define' is magic
<terpri>(cond (else (write 'o) (define k 'k) (write k)) prints "ok", seems to works fine
<terpri>work*
<manumanumanu>that expands to a simple (begin ...). try this: (define (a b) (cond ((= b 1) (define c (+ b 222)) c) (else 33)))
<manumanumanu>there seems to be some kind of limitation there. it's fine. I was just surprised.
<zzappie>hey does anyone has a tip how to prevent guile from pringing out huge records in repl?
<zzappie>*printing
<manumanumanu>it is possible, but I have forgotten how...
<manumanumanu>ah! https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html
<manumanumanu>the error printing is not afected iirc
<wingo>there is a repl option
<wingo>,option on-error print
<wingo>or something like that
<manumanumanu>",option on-error report" maybe
<manumanumanu>TIL
<lloda>i think the point isn't to replace debug/backtrace wholesale, just to fix how values are printed within those
<manumanumanu>well, the (system repl common) truncate-print trick works when there are no errors
<lloda>there's a sibling section in the guile-cv manual for truncate-printing in errors
<lloda>it's a hack tho
<manumanumanu>"The module we need to modify is (ice-9 boot-9)" ... :P
<manumanumanu>that must be the definition of a hack
<manumanumanu>are parameters available in boot-9? If that is the case, I could take it upon myself to patch it. Exceptions are, well, exceptions and having that kind of indirection wrt error printing shouldn't do much to performance.
<lloda>what that hack does is patch a function simple-format that is used in (ice-9 boot) in all the default exception printers
<lloda>if you can figure out a clean way to fix this issue that would be greatly appreciated
<lloda>imo a lot of this is kinda broken atm
<lloda>it cannot be the intention that errors print as
<lloda>'Bad on-error value ~a; expected one of ~a ...'
<lloda>you see those format specifiers leak to the generated output all the time
<lloda>anyway i think the code where the error is printed isn't in the best position to decide how values should be printed. That should be delegated to the user who has to read them
<zzappie>ooh thank you this is what I was looking for
<zzappie>but truncation doesnt work in geiser for some reason
<lloda>There is an old bug for this https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29669
<lloda>you can add that there zzappie
<lloda>likely it's bc of how geiser communicates with guile
<zzappie>only worked for (define tprint (lambda (repl obj) (truncated-print obj) (newline))) and then ,option print tprint
<zzappie>lloda: oh that was I just did yep :) define was redundant though
<dsmith-work>Morning Greetings, Guilers