IRC channel logs

2013-12-10.log

back to list of logs

<saulg>I have a general Scheme question. If given an alist such as '((x 10) (y 20) (z 30)) then is it possible to algorithmically create the bindings for the 'x 'y and 'z symbols? (The alist is read from a file and there are potentially dozens of symbols.)
<ijp>yes, but you shouldn't
<ijp>(in general)
<saulg>ijp, how would I approach it? (I think I can avoid the pitfalls.)
<ijp>there is eval, or module-define! / define!
<ijp>or you could munge the alist into a list of defines and include it in the file, or ...
<ijp>saulg: why is this an alist in a file, and not just a bunch of defines?
<saulg>ijp, it is a GIMP data file, which uses a Scheme-like syntax. For example, https://git.gnome.org/browse/gimp/tree/data/tool-presets/Selection/Feathered-Selection.gtp
<saulg>It is very easy to read the file (without comment lines) as a single alist.
<ijp>well, except for the nesting
<ijp>presumably you have some solution for that in mind
<saulg>Well, the nesting isn't a problem since the sublists are valid components of their parent.
<saulg>Unfortunately, I am using TinyScheme, which does not have define!
<ijp>if it's tinyscheme, you are stuck with eval
<ijp>saulg: are you using the GIMP? I thought they used a different crippled scheme
<ijp>siod, or something
<saulg>They used to use SIOD. They switched to TinyScheme about four years ago.
<saulg>ijp, Thanks very much for the response. It saved me a lot of time looking for something that wasn't there.
***sneek_ is now known as sneek
***heroux_ is now known as heroux
***sneek_ is now known as sneek
<tromey>I get a warning about scm_i_tag_name being defined but not used
<tromey>is there a reason to keep it?
<tromey>git grep didn't reveal anything
<mark_weaver>tromey: I don't see a reason to keep it, but I'd like to hear what civodul thinks.
<tromey>I can send a patch
<tromey>but ok
<tromey>is git send-email ok? or do you prefer a bug?
<nalaginrut>morning guilers~
<mark_weaver>tromey: either way is fine
<tromey>ok
<civodul>Hello Guilers!
<nalaginrut>heya
***tromey` is now known as tromey
<tromey>guile installs the r5rs info page -- but shouldn't it be r6rs?
<mark_weaver>tromey: no. sadly, there's a nasty split in the scheme community. The R7RS standard is based on R5RS, not R6RS, and is not compatible with R6RS.
<tromey>aha
<tromey>I don't follow scheme closely, I am vaguely aware of the r7rs situation
<tromey>however the guile manual elsewhere refers to r6rs
<tromey>bias
<wingo>yes, they are separate standards...
<mark_weaver>we support a large subset of R6RS, and I plan to continue doing so (I prefer R6RS myself).
<mark_weaver>I expect that Guile will support R7RS as well, but it was only ratified fairly recently.
<mark_weaver>well, R7RS-small was ratified. R7RS-large is still a work-in-progress, in the early stages.
<tromey>oh lispers
<mark_weaver>heh, yeah, we are a diverse community with a lot of internal division, I'm afraid.
<tromey>it's really no more than the rest of the programming world, just for some reason the idea is particularly associated with lisp
<wingo>we troll ourselves :)
<wingo>self-hosted trolling
<mark_weaver>:)
<ijp>I thought we stopped installing the r5rs info page
<ijp>maybe it was just the tutorial
<wingo>you are thinking about the separate guile tutorial, or maybe the goops manual
<wingo>the former we don't use any more, and the latter is part of the manual now
<tromey>r5rs.info is definitely there in a fresh install
<ijp>fair enough
<wingo>tromey: btw unless you are interested in master i would suggest using stable-2.0
<tromey>ok
<mark_weaver>IMO, it would be nice to include a texinfo version of R6RS in guile.
<wingo>we could do that
<mark_weaver> https://github.com/marcomaggi/nimby-doc/blob/master/src/{r6rs,r6rs-lib}.texi might be suitable
<tromey>you may consider replying to https://sourceware.org/ml/binutils/2013-12/msg00098.html
<tromey>I never read the ELF standard in the detail necessary to know whether guile's behavior here is correct
<tromey>I think guile's use of loadable debug sections is unusual at least
<wingo>i'm pretty swamped atm but we are happy to make whatever changes are appropriate
<wingo>adding an incompatible elf flavor is a non-goal ;)
<wingo>i guess i should be able to reproduce with objdump -g, right?
<mark_weaver>wingo: a day or two ago, tromey asked why the guile-generated DWARF sections have non-zero addresses. do you remember?
<tromey>objdump will fail right now
<wingo>ok, then will fix guile
<tromey>actually I think guile is ok
<tromey>eu-readelf does the right thing
<wingo>humm
*wingo mostly tested with readelf
<tromey>I think zapping this bogus mach-o workaround code from binutils is probably correct
<tromey>interesting
<tromey>like try
<tromey>readelf -wi install/lib/guile/2.2/ccache/web/uri.go
<tromey>I get messages about DW_FORM_strp being out of range
<wingo>mark_weaver: not really; perhaps it doesn't need to have an address, but it will be mapped by guile itself
<tromey>but that's due to this (bogus) offsetting
<tromey>... done by binutils
<wingo>yes i get that too
<tromey>of course guile might also be wrong, I don't know
<wingo>the .debug_info section is early days -- really just a placeholder while i figure out how to serialize local variable names
<wingo>needs some compiler work first
<wingo>perhaps DW_FORM_strp isn't commonly emitted by gcc
<tromey>it is
<wingo>hum
<wingo>i wonder why guile's dwarf reader didn't balk when reading system debug info
<tromey>binutils is taking the DW_FORM_strp argument and subtracting out the debug string section address
<tromey>but that is wrong
<tromey>gcc doesn't set the address on dwarf sections
<tromey>so this code in binutils usually doesn't trigger
<wingo>ah, i see.
<tromey>so binutils IMO is definitely wrong
<tromey>what I don't know is whether guile is also wrong
<wingo>interesting. i guess we just shouldn't set addresses for sections that are not part of loadable segments.
<tromey>guile's output claims that its debug sections are loadable
<tromey>or maybe not
<tromey>bah
<tromey>yeah, I was confused on that point
<tromey>sigh
<wingo>np, i am the newbie here
<wingo>should we set sh_addr to 0 on those sections then?
<wingo>it would seem that elf(5) says that is what should happen
<wingo>so we are in the wrong there
<tromey>it's more normal, but I don't know if it is required
<tromey>wingo: did you want me to write a patch for the elf thingy, or are you doing it?
<wingo>tromey: no i'll get it, thanks
<tromey>ok, thanks
<wingo>cheers for the debugging and spec-fu
<tromey>no problem
<wingo>tromey: fixed, i think
<wingo>at least readelf / objdump are happier now
*tromey pulls
<tromey>nice, thanks
<ArneBab>mark_weaver: as an update to wisp: I’m finding ways to style wisp-code for better readability (I actually find them, not define them). Example: http://draketo.de/proj/wisp/src/4b1ac40f7888720369ae619871c62d9dc170f25e/examples/kit-encode.w.html