IRC channel logs

2021-04-15.log

back to list of logs

***Server sets mode: +nt
***sneek_ is now known as sneek
***zap1 is now known as zzappie
***DadeBonetti1 is now known as DadeBonetti
<dsmith-work>UGT Greetings, Guilers
***DadeBonetti1 is now known as DadeBonetti
<everstone>How can I use a list of arguments as arguments instead of as a the list it is? I'm trying to do: (format %my-list)
<zzappie>everstone: you can (apply format %my-list)
<everstone>zzappie: thank you!
<zzappie>also one thing I didn't know for a long time is that ((lambda x x) 'wrapped) will result in (wrapped), this way you can ignore arity of which is sometimes handy
<lampilelo>zzappie: can you give an example? ((lambda x x) 'foo) is functionally equivalent to (list 'foo)
<zzappie>lampilelo: I meant that I always wrote (lambda (args) body) and didnt know you can (lambda arglist body). There are times for example you need a function that accepts any number arguments so you can use this for for that, or even show that you dismiss args entirely and write (lambda _ body)
*zzappie *use this form for...
<lampilelo>ah, ok, it wasn't clear to me what you wanted to say
<yoctocell>Is there a way to split a string based on a string predicate? e.g. I want "AdelimBdelimCdelim" => '("A" "B" "C"), `string-split' only accepts a character predicate.
<dsmith-work>yoctocell: https://www.gnu.org/software/guile/manual/html_node/List_002fString-Conversion.html#index-string_002dsplit `char_pred` can be a char, a char-set, or a predicate procedure.
<dsmith-work>Ah
<yoctocell>dsmith-work: Ah, ok, thanks!
<dsmith-work>yoctocell: Unfortunately, that pred gets passed only one char at a time. And from back to front too.
<yoctocell>dsmith-work: I don't think that will be a problem, I can just filter out the empty strings.
<everstone>I'm really liking this first introduction to lisp so far! To be told syntax is illegal eventho I see it used in the sourcecode is annoying, but it encourages me to be creative :^)