IRC channel logs

2021-11-26.log

back to list of logs

***berndj-blackout is now known as berndj
<lloda>wdyt about making SCM_BYTEVECTOR_TYPE_SIZE a documented macro?
<lloda>although bytevectors having a type is a Guile thing, so it's an odd fit in the bytevector section
***smartin1 is now known as smartin
***jpoiret3 is now known as jpoiret
***herlocksholmes5 is now known as herlocksholmes
***dongcarl2 is now known as dongcarl
***brettgilio3 is now known as brettgilio
***unCork is now known as Cork
***sneek_ is now known as sneek
***rgherdt_ is now known as rgherdt
<drakonis>right now, i really wish guile had an standard library that augmented srfis
<drakonis>because some srfis don't interop well
<lilyp>which ones in particular?
<drakonis>srfi-43
<drakonis>hold on
<drakonis>that's not the one
<drakonis>srfi-41
<drakonis>i'm not able to use a range generated with it
<lilyp>in a stream or...?
<drakonis>outside of streams
<lilyp>hmm
<drakonis>might need to use list-ec to generate a range
<drakonis>i'm liking what i've seen of gauche's libraries
<lilyp>i think the guile thing to do would be to define (srfi srfi-43 gnu)
<drakonis> https://practical-scheme.net/gauche/man/gauche-refe-draft/Sequence-framework.html#Sequence-framework
<lilyp>but have you tried converting your stream to a generator?
<drakonis>basically, gauche has a module that reexports an srfi but augments it with gauche features
<drakonis>there's generators now?
<lilyp>well, generators are just functions
<drakonis>i was going to just use list-ec to do it
<drakonis>then apply map to generate a random string
<lilyp>(lambda (stream) (let ((x stream)) (lambda () (let ((r (stream-car x))) (set! x (stream-cdr x)) r))))
<drakonis>aha, i did it
<lilyp>the problem with list-ec would probably be the ec
<drakonis>its not good for generating anything very long, isnt it?
<lilyp>if you're using streams, you want laziness
<lilyp>typically
<lilyp>so if streams don't work with whatever else you have, thunking/handcrafted generators are the way to go imo
<drakonis>i suppose i don't need streams right now
<drakonis>its just to implement some basic cipher
<drakonis>nothing that will see production use, its just for practice
<lilyp>ahh, right
<lilyp>for that I'd suggest simply using bytevectors
<lilyp>ice-9 arrays is a godsend :)
<drakonis>aye
<drakonis>hmm, so i can just stream-map
<drakonis>works wonders
<drakonis>stream->list and stream-map also does the trick
<drakonis>ah it works now
<drakonis>finally
<lilyp>ahh, yeah, as long as you can streamify all your intermediates that also works
<drakonis>i would still like to have a superset of srfi libraries where possible
<drakonis>but that takes work
<drakonis>anyhow, learning scheme is always good
<lilyp>to be fair (ice-9 arrays) *is* that
<drakonis>ice-9 you mean
<drakonis>but sure
<lilyp>no, ice-9 does not cover all srfis
<lilyp>ice-9 arrays covers array-related srfis + rnrs
<drakonis>i see
<lilyp>there's no (ice-9 sequences) or (ice-9 iterables)
<drakonis>yes
<drakonis>and ice-9 streams is a legacy module