IRC channel logs
2022-12-18.log
back to list of logs
<roptat>hi! is there a function that evaluates whether a predicate is true for all members of a list? <argv>roptat: not an expert, but you can use filter and match the length <flatwhatson>they're fun but started to overrun my "free time" budget :) <argv>flatwhatson, chrislck do you mind if i ask for your solutions? I did it until 10a but this was my first time with Guile and it would be interesting to see other guile solutions. <argv>what is the significant of using % before variable names? Is it some convention? <argv>looks like i could've saved some effort with ice-9 match 😅 <argv>chrislck: heh, initialized vectors in day 5 <argv>heh for me day 7 was the one where i lost sleep <argv>missed the case where dirname can be same under different trees, wrote two different implementation and got same wrong answer <dadinn>the docs say: " If template-id is false, the datum will have no lexical context information. " <dadinn>while my code throws error: In procedure syntax-wrap: Wrong type argument in position 1 (expecting syntax object): #f <mwette>hmm ... reading the source, it seems to take #f <mwette>can you try adding bogus source? (datum->syntax #f 'stuff #:source (vector "foo.scm" 1 1)) <mwette>maybe bug crept in w/ update to reader <mwette>So, if try your expression at the repl prompt it returns #<syntax stuff> <mwette>I think it may be something else. <dadinn>I just enter (datum->syntax #f 'stuff) in the REPL, nothing else. My guile version is 3.0.5 <dadinn>if I do (datum->syntax (syntax #f) 'stuff) then it returns #<syntax stuff> without error... but how do I check that it is indeed without any context? <dadinn>I am trying to define those symbols (pid, loop, line, port) to be returned verbatim, without any context. Unlike expect-port which I would expect to be captured in the context calling the macro. <dadinn>Just wanted to experiment whether I understand syntax-case correctly enough to be able to rewrite it hygienically :/ <mwette>maybe use your (syntax #f) workaround until you can use 3.0.8 or whatever fixes that <mwette>to check (source-properties (datum->syntax #f 'stuff)) => '() <roptat>xd1le, thanks, than's exactly what I wanted, I was looking for "forall" in the manual but of course it wasn't under that name ^^' <lilyp>forall sounds rather close to for-each ;) <roptat>"for_all" is the name of that function in OCaml <roptat>that's why I thought of this name <civodul>roptat: speaking of which, ocaml 5 is out! <dadinn>mwette: my assumption about source-properties is that it only contains the filename line and column where the syntax object was defined. I would assume that is not the same as the lexical context which is used by the syntax transformer? Is there some way to retrieve that information? it's called "template-id" in the docs :/ <mwette>I think they are essentially the same. Guile now (internally, at least) uses a vector version of source properties alist. <mwette>You can look in ice-i/psyntax.scm, at macroexpand. <mwette>rlb: I get the drift that you are working on update to string handling in Guile. Does your work address the task of moving strings to/from bytevectors? Currently, two copies are required (e.g., string->utf and bytevector-copy!).