IRC channel logs

2014-05-09.log

back to list of logs

<can>hi
<nalaginrut>morning guilers~
<DrDuck>guile-2d looks reallly cool
<nalaginrut>yeah
<jmd>At what size does an alist become untenable?
<taylanub>jmd: depends, I'd say
<jmd>taylanub: Upon ?
<taylanub>jmd: many things :)
<taylanub>how often will you do look-ups from this alist, how often will you insert new values, does your application need to be fast at all, or about how much?
<taylanub>I'd say, write your code in the simplest/cleanest way first, care about optimization later. Maybe provide an abstracted mechanism to do lookups and insertions to some "dictionary" of yours, which you can then change to use different types of dictionaries (alist, hash-table) easily
<jmd>ok I'll do that.
<jmd>I need to populate an alist in a recursive procedure. It gets a bit hairy. Is there an easier way?
<taylanub>I don't see the difference between populating an alist from a recursive procedure and populating it from any other procedure...
<jmd>Its just a case of how to terminate the recursion
<jmd>What is the clean way to set the exit status from guile?
<nalaginrut>exit I think
<jmd>nalaginrut: makes sense
<nalaginrut>jmd: the original posix one is primitive-exit, I think
<ArneBab>Did anyone already consider implementing an RPython backend (simplified Python syntax) and then using the pypy-parts to implement Python in Guile? (essentially rebasing pypy from Python to Guile): http://doc.pypy.org/en/latest/coding-guide.html#id1
<nalaginrut>I have no plan for Python, but I'd like to see it ;=)
<ArneBab>same for me ☺
<jmd>I need to convert a string containing a hexidecimal representation of an int (eg 0xABDE) into a number. Is there a function that will do that for me?
<taylanub>jmd: string->number
<taylanub>well, doesn't directly work on 0x...
<taylanub>it works on #x..., simply replacing the 0 to # comes to mind but that might be a bad solution
<jmd>ok. I'll strip off the 0x then.
<civodul>Hello Guilers!
<dsmith-work>Happy Friday, Guilers!!
<taylanub>happy Friday afternoon :)
<taylanub>for me, anyway
<taylanub>.oO(That was mean.)
*nalaginrut lost his smart phone...he feel terrible...
<nalaginrut>well, I wish I can have a free phone
<daviid>hello guilers, happy friday all indeed!
<daviid>within a given module [not an executable script], shouldn't all dynamic-call be encaps in (eval-when (compile load eval) ...) ?
<dsmith-work>daviid: Only if you need to evaluate it when compiling, loading, ...
<dsmith-work>daviid: I've found you need to wrap calls to load-extension
<daviid>^ when the (dynamic-call ..) is a top level expression in the file I mean. here is an example which gives warning @ compile time: http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gtype.scm
<dsmith-work>In that case, you probably DO need to evaluate it when compiling, loading, ...
<daviid>dsmith-work: thanks, I'll send a patch, there are 4 calls in that gtype.scm file which needs to...
<daviid>shouldn't it be the case also for this last expression call in the file? http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gobject.scm
<daviid>it can't be armful to surround these by an eval-when anyway, I realize it is more not to trigger warning at compile time
<daviid>related to this paste, I have a couple of questions for C/libguile experts: http://paste.lisp.org/display/142469
<daviid>1) why did it not trigger a warning for the first call to scm_list_ref? 2) how to avoid these warnings and/or anything wrong whith these calls?
*taylanub wonders what the difference between load and eval are, re. eval-when
<taylanub>oh, load just means eval-of-compiled
<taylanub>(i.e. 'expand & eval' parallel 'compile & load', the former for uncompiled code, the latter for compiled)
<dsmith-work>Yeah, I wish the docs on that had a little more explanation.
<taylanub>I'm reading the 2.1 manual, it seems pretty clear to me. Except on why it recommends (expand load eval), excluding compile from the list ...
<taylanub>oh sorry, expand is not related to whether the code is or isn't compiled
<daviid>to complete my above quizz, a ClutterMatrix is a CoglMatrix, and a CoglMatrix is defined like this: http://paste.lisp.org/display/142469#1
<daviid>is this not a bug in libguile/list.c[h] ?
<daviid>impossible for me to understand the compiler does not raise a warning for the first call: ret.xx = scm_to_double (scm_list_ref (scm, 0)); ?
<daviid>s/understand/understand why/
<daviid>I can see scm_list_ref expects the following 2 args: (SCM list, SCM k)
<daviid>then it calls i = scm_to_ulong (k);
<daviid>found an example
<daviid>I have to call scm_from_int
<daviid>hum, if in this file I change line 90 to (eval-when (compile load eval) (%bless-gvalue-class <gvalue>)), it raises an error at compile time: I thought that all call could and should be surrounded by an (eval-when ...) form [ http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gvalue.scm ]
<daviid>s/all/all top level calls
<dsmith-work>daviid: Only calls that need to be made in the specified condiftions.
<daviid>dsmith-work: and no eval-when is equal to (eval-when (load eval) ...) right?
<dsmith-work>daviid: Not sure.
<dsmith-work>Where is that wingo when you need him?
<daviid>because if not, they should be surrounded by... not a big deal thought, these days almost nobody uses eval I guess
<dsmith-work>Yeah, common wisdom is eval is evil
<daviid>haha