IRC channel logs


back to list of logs

<nalaginrut>morning guilers~
***cluck` is now known as cluck
***_zxq9_ is now known as zxq9
<civodul>Hello Guilers!
<ArneBab>moin civodul
<dsmith-work>Morning Greetings, Guilers
<rekado_>mark_weaver: I know how to use macros only to create new syntax that is then used by clients, not how to use macros to generate defines at load/compile time.
<rekado_>Playing with the sxml modules I found that the documentation is a little poor. Looking at the source files I can see a couple of examples that simply are not in the info docs. Is anyone working on this or may I send in patches?
<davexunit>send patches!
<mark_weaver>rekado_: macros can generate definitions, and syntax-case macros can run arbitrary code to do this at compile time.
<mark_weaver>rekado_: it's possible that 'eval' is the right choice for you, but personally I've never needed to use it. If you tell us more about what you're trying to do, maybe it will become more clear.
<rekado_>mark_weaver: I have only ever used macros with syntax-case, but only to define new syntax to be used elsewhere in a client of my library.
<rekado_>here's what I'm doing now:
<rekado_>this generates a couple of convenient top-level functions that I wouldn't want to write by myself.
*mark_weaver looks
<rekado_>It's a little less readable than what I had hoped for, but it works fine.
<rekado_>This sits in a module file that I load elsewhere with use-modules
<mark_weaver>ah, yes, that can be done easily with macros. give me a minute
<mark_weaver>rekado_: btw, Guile has a procedure called 'symbol-append', so you could just do (symbol-append 'stanza- attr)
<rekado_>ah, good to know"
<mark_weaver>to see what it expands to, type this at the REPL: ,expand (define-attributes (from to type id))
<mark_weaver>it's made more complicated by the fact that the macro is not hygienic by design. it generates a new identifier that's not present in the input form.
<rekado_>mark_weaver: I see. Thanks!
***dje is now known as xdje
<stis>Funcitonal programming is magic
<stis>srfi-9 gnu, is lovely!
*davexunit should probably use that more
<davexunit>but personally I don't associate (set-foo) with a pure function
<davexunit>so I try to come up with other verbs to use instead
<davexunit>but it doesn't work out
<stis>well the ! is not there, so it is functoinal
<davexunit>I know that, but it's the 'set' part
<stis>in stead of set
<stis>perhaps new, e.g. new-person
<stis>in stead of set-person
<stis>(naming is difficult)
<davexunit>in some cases it's easy, if I have a person with a position field, I can say move-person
<davexunit>but the verb doesn't always stand out so easily
<stis>davexunit: what do you think of my latest mail ...
<stis>should we have functional streams in guile?
<davexunit>I haven't seen that mail
<davexunit>how do these streams differ from srfi-41 (I think) streams?
<stis>guile-devel, I just sent it!
<taylanub>SRFI-57 is interesting. it uses the word "update" to return a record copy with certain fields changed.
<davexunit>ooh, didn't know what was a srfi
<stis>You need to maintain two stream in the case of rw
<stis>nice to do that in a unified interface with r and w
<davexunit>I'll have to read more about these streams
<davexunit>I wrote a functionally reactive programming module awhile ago, which you could consider time-based streams
<davexunit>mutable data types with a functional api
<stis>well it's file streams and more functional ports then streams I'm heading at
<davexunit>I was thinking srfi-41 stream
<stis>saw that, prolog uses the word stream for ports,
<stis>my main ick with prolog ports us that you can't make them backtrack
<stis>and is an oddity in prolog
*stis want to change that!!
<davexunit>speaking of functional programming, I've been trying to think through how to write a purely functional API for a particle simulation.
<davexunit>my best lead so far is to do something like git, and store a series of 'diffs', that when folded together, yield the state of the system at the current time.
<stis>Hmm, thats interesting, I guess that you then can push the chunk to C land and avoid hefty consing
<davexunit>I was thinking of keeping it all in scheme and seeing how it goes
<davexunit>by having a cache that stores the latest generation
<paroneayea>davexunit: what was the peer to peer protocol thing you were using with guile via the FFI?
<paroneayea>I was looking at telehash and remembered there was another relevantish thing
***_zxq9_ is now known as zxq9
***adhoc is now known as adhoc_drupalcamp