IRC channel logs

2016-05-06.log

back to list of logs

***amz31 is now known as amz3`
<amz3`>héllo #guile
***DerGuteM1 is now known as DerGuteMoritz
<fhmgufs>What's the procedure to create a string using arguments like in (format ...) but not for output?
<df_>(format #f ...)
<fhmgufs>Ah, ok.
<dsmith-work>Happy Friday, Guilers!!
<fhmgufs>(define a 2)
<fhmgufs>(define b 'a)
<fhmgufs>Can I do sth to get 2 from b
<fhmgufs>?
<Wojciech_K>fhmgufs: (primitive-eval b)
<fhmgufs>Wojciech_K: Thanks!
<mark_weaver>fhmgufs: also see sections 6.19.7 (Variables) and 6.19.8 (Module System Reflection) in the guile manual
<fhmgufs>Ok
<mark_weaver>fhmgufs: although I'm tempted to ask why you want this, because it's very rare to need this kind of thing
<mark_weaver>more often than not, things can be done in a better way
<fhmgufs>mark_weaver: I have a property of a GOOPS object telling it which variable to use for a specific action.
<mark_weaver>it would be cleaner to say (define b (lambda () a)) and then (b) will fetch a
<fhmgufs>Yes, that sounds better.
<random-nick>or hashtables
<mark_weaver>or more generally, have an explicit data structure mapping names to values, which could be a hash table, vhash, association list, etc.
<random-nick>what is the advantage of vhashes to hashtables?
<davexunit>random-nick: vhashes are persistent
<random-nick>and hashtables are faster?
<davexunit>not sure.
<davexunit>I imagine they are faster for some cases
<davexunit>a simple alist is faster than a hash table when the data set is relatively small
<mark_weaver>random-nick: hash tables are definitely faster, but they also have the unfortunate property that they very often force the code that uses them to be written in an imperative style.
<mark_weaver>there's no efficient way to update a hash table while keeping the old version around
<mark_weaver>vhashes could be a lot faster than they currently are. they are implemented in pure scheme, which will be okay when we have native compilation, but in the meantime we are paying an efficiency cost for it.
<mark_weaver>although I think that purely-functional HAMTs are a better approach
<random-nick>HAMT?
<mark_weaver>Hash array mapped trie
<mark_weaver> https://en.wikipedia.org/wiki/Hash_array_mapped_trie
<mark_weaver>clojure uses persistent HAMTs
<mark_weaver>see the "implementations" section of the page above
<daviid>mark_weaver: don't we have a HAMT implementation somewhere around?
<fhmgufs_>How can I pass a string to (format ... ) ?
<mark_weaver>daviid: I think ijp has one written in portable R6RS scheme in his pfds library, although I don't know how well optimized it is
<daviid>fhmgufs_: you'll find example in the manual, read the fine manual
<mark_weaver>daviid: and wingo also wrote something that might be similar with persistent HAMTs, dunno.
<daviid>mark_weaver: ok, I can of remembered, this confirms
<davexunit>mark_weaver, daviid: https://wingolog.org/pub/fash.scm
<davexunit>I would like to use HAMT-based persistent vectors/hashes in my projects
<davexunit>would be particularly useful in Sly
<mark_weaver>davexunit: ah yes, thanks for that pointer
<daviid>davexunit: tx, but fash.scm is 'not really' a HAMT implementation right?
<mark_weaver>random-nick: https://wingolog.org/pub/fash.scm
<davexunit>daviid: its implementation is based on clojure's
<daviid>davexunit: tx, I see in the source code it is a HAMT impl. good we have that!
<daviid>wingo: any plan to include fash in guile core 1 day?
<davexunit>I want them in guile core badly, but I think wingo has some reservations about the current state of this implementation.
<davexunit>I just can't recall the details.
<daviid>atomic ref maybe?
<daviid>davexunit: but yu can surely already use them I guess, it would be a fantatic testing suite for fash...
<daviid>fantastic*
<paroneayea>hello everyone
<holomorph>ahoy