IRC channel logs

2014-09-11.log

back to list of logs

<daviid>need to loop from 1968 [as an example], 1+ ... till I find an available port to spawn a server, catching [ignoring] errors of all unsuccesfull attempts: any example that I could copy?
***La`Tisha is now known as Islaminati
<yc`>hi, is it possible to use a macro before it is defined? I get `Wrong type to apply #<syntax-transformer ..> error when I use a record constructor before doing `(define-record-type ...)`, for now I put all record definition at top but I like to split them into different modules...
<ijp>I think the answer is "it depends"
<ijp>it should be fine most of the time
<yc`>well, it doesn't appear to work for me, using modules is little frustrating when I still have to think about code evaluation order.
<yc`>maybe I should stop having modules including each other
<ijp>a literal include, or use-modules?
<yc`>use-modules
<ijp>yc`: are these modules mutually recursive?
<ijp>e.g. (define-module (foo) #:use-module (bar)) (define-module (bar) #:use-module (foo))
<yc`>ya, I suppose that is a bad thing to do?
<nalaginrut>morning guilers~
<ijp>yc`: it can be problematic
<yc`>ijp: it mostly works, although I get some warnings about missing definition but thye get defined later on, but macro just doesn't work.
<ijp>well, it may be to do with imports being processed before exports (which is a known issue whose fix hasn't been applied)
<ijp>but without an example I can't be more specific
<yc`>ijp: well something like this https://gist.github.com/anonymous/13ae7b5ebdcdc57c7e0d
<nalaginrut>hmm...it's bad module design
<ijp>I think civodul's exports patches would allow this, but yes
<nalaginrut>I think Guile will support this, but I still refactored some modules of Artanis to eliminate such bad reference dependency
<nalaginrut>or it's hard to read the code and reason about the architecture
<nalaginrut>anyway, even eliminate them all is hard...
<nalaginrut>so I kept some trivial
<ijp>nalaginrut: like I say, the patch is there, it just never got applied
<nalaginrut>ijp: maybe it should never
<nalaginrut>but more friendly error message is better,
<nalaginrut>people maybe confused with the current error msg
<nalaginrut>sometimes I could write wrong import module which may cause the same problem
<nalaginrut>and the error msg doesn't provide useful info for me to find out problem
<civodul>Hello Guilers!
<nalaginrut>heya
<nalaginrut>it's better to have some status on r7rs branch ;-)
<janneke>morning!
<janneke>i was wondering
<wingo>moin :)
<janneke>would it be nice to have catch accept a list of keys?
<janneke>ie, something to go between symbol and #t?
<janneke>hey wingo!
<janneke>i was trying to read the code in boot-9 but don't understand it yet
<wingo>nice
<wingo>janneke: yes i guess that would be nice
<wingo>or in general, the ability to discriminate more on whether a handler actually handles the exception...
<lloda>hello, can I use match-lambda for a function taking > 1 args?
<lloda>say (map (match-lambda* (((a b) c) ...)) '((a b) (a b) ...) '(c c ...)) instead of (map (match-lambda (((a b) c) ...)) '(((a b) c) ((a b) c) ...))
<wingo>lloda: i think so
<wingo>it's not well-documented
*wingo looks
<wingo>lloda: yes, it's even spelled match-lambda* :)
<lloda>it was a guess :D
<wingo>hehe
<wingo>on my side i never remember which is which
<wingo>i guess the * should make me think of bnf grammars
<civodul>damn, i didn't know about match-lambda*
<lloda>it seems typical to add * to alternates, however they differ
<civodul>yes
<wingo>i guess like haskell's '
<lloda>wingo, about interning arrays in master http://paste.lisp.org/display/143677
<lloda>maybe one can intern the shared-array root and return the (with-shape ) array? but it probably doesn't work like that.
<wingo>do you think it is correct to error on those arrays?
<lloda>i've fumbled a bit with the recurs and make-non-immediates :(
<lloda>no, not at all!
<wingo>do i understand correctly that this is the case of a non-contiguous literal array
<wingo>or just a literal array with different bounds?
<lloda>literal arrays are always contiguous
<wingo>ok
<lloda>just a literal array (with different bounds, but it doesn't work now either way)
<lloda>#2() -> don't know how to intern error
<wingo>ah.
<lloda>actually I would very much like to deprecate lower bound != 0, will write to the list about that (not much hope, but...)
<lloda>if you don't have the time, I could use a clue. `(make-non-immediate ? ,(with-shape (recur (shared-array-root obj)) (array-shape obj))) ?? does one have to place the shared somewhere with static-??? -> i'm pretty lost down there
*wingo looks
<wingo>sorry, ploughing through 2K work mails at the same time :P
<lloda>I sympathize :)
<wingo>ok
<wingo>so asm-constants is a vhash mapping object -> label
<wingo>the label represents the point in the image corresponding to the object
<wingo>that space in the image -- that allocated memory -- may need some fix-up when the image is loaded
<wingo>for example if it references other objects in the image
<wingo>so there is a list of "inits" held by the assembler
<wingo>which is a list of VM instructions needed to initialize the objects
<wingo>it is built in reverse order, so the last instruction in the list will be executed first
<wingo>in that way all the sub-objects of an object are already initialized when the object itself comes to be initialized
<wingo>so what is an array
<wingo>it's like 4 words, no?
*wingo looks again
<wingo>the first cell has the tag and some flags, the second cell is a pointer to a scm_i_t_array it seems
<wingo>(seems a needless indirection to me; they could be allocated together)
<wingo>and i guess they can be allocated together
<lloda>i think it's both, the pointer is to right after (not sure now)
<lloda>so one has to build the scm_i_t_array by hand here?
<wingo>so the words are like tag+flags, pointer-to-word-2, vector, base, dim 0, dim 1, ...
<wingo>yes
<lloda>ahh
<wingo>so first you recurse to build the backing store, and you have a label for the backing store
<lloda>(recur shared-array-root obj)?
<wingo>then you do the same for the dimensions (which are pairs, no?)
<lloda>(recur (shared-array-root obj))?
<wingo>yeah something like that
<lloda>the array-shape is a list of (lower-bound upper-bound) lists
<wingo>yeah but in memory is it a list?
<wingo>i think in memory it's just an array
<lloda>it's all C
<wingo>ah it's a scm_t_array_dim*
<wingo>yeah, then dim 0, dim 1 etc are three ssize_t values
<wingo>which really should be uintptr_t...
<wingo>or intptr_t, rather
<lloda>isn't intptr_t 32 bits? but the sizes could be larger
<wingo>intptr_t is as big as your pointers are wide
<lloda>ok
<wingo>brb
<wingo>ok i think the ssize_t thing is fine
<wingo>anyway
<wingo>that gets written out in a second phase
<wingo>see link-data
<wingo>e.g. see around line 1312
<wingo>the (string? obj) case
<wingo>there you see how we initialize the 4 words in the string
<wingo>one of the words points to a sub-object (the stringbuf)
<wingo>there we just write a zero, and know that it will be fixed up at runtime
<wingo>otherwise we write the words as they will be in memory
<wingo>so there you will have to add a case for arrays -- to recreate the memory structure of an array
<wingo>and for the word that points to the vector you just write a zero
<wingo>you'll also have to add a case to byte-length (around line 1252)
<lloda>thanks a lot, that should help me finally do it.
***aburgess_ is now known as aburgess
<dsmith-work>Hey hey
<Islaminati>dsmith-work, I believe in the systemic punishment of subroutines-as-parameters.
<Islaminati>There should be a constitutional principle to forbid it.
<Islaminati>And they should be banged.
<stis>evening guilers!
***Islaminati is now known as keem
<dsmith-work>Heya stis. I just saw something about prolog and was reminded of you..
<dsmith-work>stis: http://lambda-the-ultimate.org/node/5043
<davexunit>pretty neat presentation: "Organizing Functional Code for Parallel Execution; or, foldl and foldr Considered Slightly Harmful" by Guy L. Steele - http://vimeo.com/6624203
<ota>I found the slides. no longer easily available at "Sun": http://xahlee.info/comp/i/ICFPAugust2009Steele.pdf
<davexunit>thanks ota
<davexunit>"linked lists are so 1950s" :(