<madsy>Ahh.. lovely. I just got generated all the 1200 opengl enums for my alist <ArneBab>saul: when emerging lilypond 2.18, it tells me ERROR: Please install required programs: guile-config < 1.9.0 (installed: 2.0.9) (guile-devel, guile-dev or libguile-dev package) or guile1-config (guile1-devel package) libguile (libguile-dev, guile-devel or guile-dev package). GUILE-with-rational-bugfix ***wleslie_ is now known as wleslie
***dsmith-w` is now known as dsmith-work
<adhoc>i'm looking to do some GUI apps <adhoc>and was looking at FLTK as i've used it about a decade ago <adhoc>and looking for the guile-fltk binding, have found some but limited info on it <wleslie>I prefer tk myself, but I've never tried it from guile <saul>ArneBab, I will look into it this weekend. I haven't installed Lilypond yet, but was basing its Guile 2 support on the dev branches change logs. <mark_weaver>adhoc: I didn't even know guile had bindings to fltk. I haven't heard anyone mention them until now. <adhoc>wleslie: gkt, is a little bit more than i was willing to chew off <mark_weaver>but if there's a fltk binding, maybe it will just work, or wouldn't take much to get it working, dunno. <cluck>even if there were no bindings it shouldn't be hard to use fltk with guile's ffi <adhoc>i just found a tarball of 0.1.2 <adhoc>other searching suggests there was at leas 0.4.0 in the wild <adhoc>-rw-rw-r-- 67999 Jun 28 1999 guile-fltk.0.1.2.tar.gz <adhoc>anyhow, i'll have a tinker with that <adhoc>its just all the reading i've done and use of py+gtk has been too menory heavy for the embedded apps i'm working on <mark_weaver>one thing I should say though: it's important to use guile-2.0.x. We dropped support for guile-1.8 about 3 years ago. <adhoc>i think it must be a git/tarball install as debian/wheezy seems to whip 2.0.5 <adhoc>ok so why gtk and not something else, like qt? <mark_weaver>gtk is specifically designed to be easy to make bindings for. qt is pretty C++ centric. <mark_weaver>it could certainly be done, but it would be a lot more work. <didi>Last time I checked, there was no readily available gtk binding to Guile. <adhoc>the repo shows the last guile-gtk release as 2.1 in dec 2007 ? <wleslie>wingo was a big gnome geek so such things are readily supported <mark_weaver>guile-gnome is the one you want. it includes a gtk binding. it's modularized so you don't have to include all the gnome stuff if you don't want. <didi>Maybe things have changed, but guile-gnome could not be readily run with the last stable version of guile. <adhoc>whats the story on gnome3 desktop ? <adhoc>or more to the point non-gnome window managers ? <wleslie>gnome isn't a window manager, but you can just use the components you need really <wleslie>you don't need to be running a full gnome DE to use a gstreamer application, for example <mark_weaver>guile-gnome contains bindings for several libraries that are important in gnome. you can pick and choose the ones you want to use. <didi>Is it possible to know the arity of a procedure? ***wleslie_ is now known as wleslie
<zRecursive>How to break and return from a loop when some condition meet ? <didi>zRecursive: You can use a continuation. <mark_weaver>zRecursive: as didi said, continuations are the most general method. if you want something traditional, guile has a 'while' form that supports 'break' within. <mark_weaver>delimited continuations in particular (see 'call-with-prompt' and 'abort-to-prompt') <b4283>nalaginrut: ah! i was gonna beat you to say it! <b4283>nalaginrut: too bad my fingers are too slow to type ;) <mark_weaver>didi: in general, a given procedure can support any number of arities, as well as things like keyword arguments, etc, so it's not that simple. out of curiosity, why do you want this? <didi>mark_weaver: Not that I need. I was just curious. Partial application is already enough for my needs. <mark_weaver>didi: well, it's easy to write a macro that lets you define a curried procedure, anyway. <mark_weaver>there *are* ways of getting the supported arities of a procedure, but they are sort of internal things and subject to change. not a good thing to base your code on. <didi>OK, I'll read it. Thank you. <didi>mark_weaver: Thank you for the reference. ***wleslie_ is now known as wleslie
<foeniks>when I develop a guile module (define-module ....) and I start writing code there, I kind of feel that the verbosity level of compiler/interpreter error messages is way smaller <foeniks>compared to when running the script with $ guile script.scm <mark_weaver>is it compiling the module? if so, you should see messages to that effect the first time you load it since modifying it. <mark_weaver>a module named (foo bar baz) should go in <DIR>/foo/bar/baz.scm, where <DIR> is a component of %load-path <mark_weaver>and then use ,use (foo bar baz) to load it. that will also compile it. <mark_weaver>it's true that error messages aren't nearly as useful for non-compiled code. <mark_weaver>an easy way to add a directory to %load-path is to set GUILE_LOAD_PATH in your environment before launching guile. <foeniks>It seems that ,use is not listed by ,help all or ,help module <mark_weaver>for me, it's shown in both of those places. what version of guile are you using? <mark_weaver>ah, it's called ,import in the left column, and ',use' is an abbreviation shown in the middle column. <mark_weaver>also see ,reload which is useful if you made changes to the module and then want to reload it without restarting guile. <foeniks>Is there a namespacing technique in guile? Such as clojure's prefixing with namespace/localname ? <mark_weaver>guile allows you to rename the symbols that are imported from a given module using an arbitrary renamer procedure. we provide one to add a prefix. <mark_weaver>scheme identifiers do not have an namespace/localname syntax in the language, though. <mark_weaver>guile allows you to reference an arbitrary exported identifier from an arbitrary module (without even importing it) using the syntax (@ <module> <identifier>), e.g. (@ (ice-9 popen) open-input-pipe) <mark_weaver>if you use @@ instead of @, then you can access non-exported identifiers as well. <mark_weaver>but personally, I'd recommend avoiding that syntax when you can. <nalaginrut>mark_weaver: BTW, how can I get unexport things if I can't use @@ under some situation? <nalaginrut>for example, I have a list '(mod aaa) as a module path, and I want to get unexported symbols from it <nalaginrut>well, the introspection of modules lacks of docs <mark_weaver>you know about the 'i' keybinding in emacs info mode, yes? <mark_weaver>well, it's supported in the standalone info reader too, but I never use that :) <mark_weaver>I don't know. I just type 'i' in the guile info manual within emacs. <nalaginrut>hmm...I can't catch it, type 'i' in Emacs screen? <mark_weaver>nalaginrut: do you know how to read texinfo manuals within emacs? <mark_weaver>it will take some learning how to use info mode in emacs, but it's well worth your time. *nalaginrut can't claim he 'can' use Emacs anymore.. <nalaginrut>so the module-ref and module-set! will ignore whether the symbols are exported? <mark_weaver>I already said that. please don't waste my time. it's all in the manual. <b4283>nalaginrut: go to #emacs.tw for chinese emacs disscussion ! :D <nalaginrut>I'm sorry, but I said so because I can't find the 'unexported description' in the module-ref item <nalaginrut>anyway, it's trivial, I can just confirm it by practice <mark_weaver>exported vs non-exported is a matter of whether you use 'resolve-module' or 'resolve-interface'. <mark_weaver>anyway, I apologize for snapping at you. I just need sleep.. good night, and happy hacking. <nalaginrut>OK, I think this is the key info for my question <nalaginrut>alas~I really understand a tired hacker's feeling... <ArneBab_>How can I get the module in which a given binding was defined? <ArneBab_>I tried procedure-properties, but that does not give the module <ArneBab_>Essentially I would need the equivalent to (current-filename), but (filename-in-which-this-binding-was-defined) <ArneBab_>as simple testcase: ,use (srfi srfi-1) (<something> list-tabulate) ⇒ /path/to/srfi/srfi-1.scm <nalaginrut>ArneBab_: well, there's a way to parse the module name from apropos <ArneBab_>nalaginrut: can I also get that from code? <ArneBab_>(somehow it must be possible: apropos can do it…) <nalaginrut>you need a way to hold the string rather than print it out <ArneBab_>yes, and to pass it any atom, not only strings <jmd>I don't understand why array-set! inside of let seems to do absolutely nothing. <nalaginrut>ArneBab_: you can get the exact info easily from procedures, with program-module <nalaginrut>ArneBab_: I used such trick in nala-repl, to find out the source of any procedure <ArneBab_>nalaginrut: in which module can I find that? <ArneBab_>nalaginrut: I’m writing about my experiences with Guile from the view of a Pythonista, and I’m currently checking for the hackability of Guile <ArneBab_>(in python you just access some magic variables like __dict__ or __locals__() <nalaginrut>but unfortunately, it not always work. Because some proc are written with C, or macro, so can't catch them <ArneBab_>I cannot call (program-module ...) → unbound variable <nalaginrut>ArneBab_: you want to know what things were exported in a certain module? <ArneBab_>I want to know it the other way round: From which module does this binding originate <nalaginrut>can you show that what you want to do in python? <nalaginrut>ArneBab_: for program-module, you need (system vm program) <ArneBab_>In python I just do `import math; math.__file__` → filename of the module. <nalaginrut>well, I have loaded bunch of modules in ~/.guile, so I can't tell which are in default module sometimes <ArneBab_>but this is a perfect usecase for program-module: (program-module program-module) ☺ <ArneBab_>and it gives the same result for program-meta <jmd>nalaginrut: Oh that's wierd. On this machine it works. <ArneBab_>ah… Can return ‘#f’ if the compiler could determine that this information was unnecessary. <ArneBab_>nalaginrut: yes, just C-s program-module C-s C-s ... in the info <nalaginrut>so Guile is clever enough to avoid self-reference <ArneBab_>It rather seems that it optimizes that away <ArneBab_>((program-meta list-tabulate)) ⇒ huge list, including the filename (but not the full path) <ArneBab_>((program-meta program-module)) ⇒ (() () ((3 7 1 0 #f)) (name . program-module)) <nalaginrut>hah, seems the manual got improved a lot these months <nalaginrut>once I've read the manual carefully, so I program with the old version manual I remembered in my mind <ArneBab_>now I just need to be able to find the absolute path to that… <nalaginrut>ok, actually, you need to get the file includes the module <ArneBab_>yes - to easily find out where to fix code <ArneBab_>(and then the same for defined variables) <nalaginrut>in my case, I have to find all the possible files one by one <nalaginrut>anyway, IMO, once the module get compiled, you can't assume its original absolute path <nalaginrut>so a better solution to get source code of any procedure is to add a special info for that. <ArneBab_>so this could be ambigous, if the name gets reused? <nalaginrut>ArneBab_: I assumed the modules will load in the %load-path list order, if it' <nalaginrut>anyway, after we have even half baked ELF support, I think it's easier to add source code into object file <nalaginrut>so we never need to find out a module file anymore <ArneBab_>that would be quite useful - does it come with the CPL-change? (register machine) <nalaginrut>I call it half-baked because our AOT still under construction *ArneBab_ thought guile already used ELF <nalaginrut>ArneBab_: IIRC, wingo once said it *is* ELF wrapped go file <nalaginrut>it'll be real ELF format after AOT is done, I think <nalaginrut>but for 'source code' case, I think it's ok to put the source code in <nalaginrut>anyway, the source code problem can be solved in the future in a better way <nalaginrut>ArneBab_: but your need is not about source code ,right? <ArneBab_>it’s just about being able to quickly find where the source is <ArneBab_>or rather: whether I could use similar hackery as in Python ☺ <nalaginrut>well, IMO, even if Python provides such thing, it's not so nice <nalaginrut>as I said, once a module get compiled, you can't assume its absolute path <ArneBab_>it leads to things like “find my game image files relative to the scriptfile” <nalaginrut>unless there's a convention for that, or I think it's harmful to be used <ArneBab_>it hurts on the long term - but it can be very useful for quickly getting up to speed <ArneBab_>nalaginrut: I’m explicitely checking whether Guile allows me to shoot myself in the foot like Python ☺ <jmd>ArneBab_: Pythons don't have feet. <ArneBab_>it’s really cool - and just got licensed in Germany <civodul>folks, how's the potluck hack going? :-) <ijp>civodul: alas, programmers block <nalaginrut>although I have something could be showed, but it's too hurry <nalaginrut>when you want to use a var named 'potluck', you have to declare it in advance hmm... <nalaginrut>civodul: ah~seems I have only Saturday for it ;-D <nalaginrut>alright, I unsubscribed guile-user by some mistakes when I was changing my mail client <sankey>i think the "&" html sequence here is wrong? <ijp>heh, I'd completely forgotten about the faq <ijp>the example is doubly wrong because we don't have bound? either <ijp>and you don't need ice-9 optargs <civodul>sankey: actually this FAQ is well outdated <ArneBab_>civodul: better add a redirection Link to the top <stis>evening guilers and, as said before, Happy Friday! <mark_weaver>basically, I'm wondering what your thoughts are on what filename to use for (foo :5) in R6RS or (foo 5) in R7RS. <mark_weaver>I was leaning toward just using the number directly, but I don't know all the relevant issues. <stis>Hehe, it's a bit difficult to implement numbers according ro iso-prolog implementation <stis>guile is so blody smart that sin(0) is an integer solution etc. <mark_weaver>0.0 is also an integer, it's just not an exact integer. <mark_weaver>ah, so prolog doesn't have a way to distinguish operational equivalence from numerical equivalence. <stis>they also tend to compare inexact numer with an eqv and not with explicity range check <mark_weaver>how does it work in prolog? how does one normally compare numbers? are floats distinguished from exact integers? <stis>yes they are two different types <stis>you need explicit type cast to compare them <stis>on a second though I will wrap the needed function with exact->inexact <stis>else you may get really hard to find bugs *mark_weaver goes offline for a bit... <foeniks>can I use macroexpand to expand into scheme and not tree-il <mark_weaver>foeniks: out of curiosity, what were you planning to use this for? <foeniks>I would like to see to what s-expr my scheme expression is transformed to reason about [[the macro <mark_weaver>please note that the 'master' branch is not yet fully functional, and is not ABI stable, so if you build any libraries against it, you may have to recompile those libraries again from time to time. <mark_weaver>(well, the only missing functionality I know of is that the debugger is not quite there yet) <mark_weaver>Depending on your needs, the 'stable-2.0' branch might be preferable for now. <foeniks>I am bound to a mac at the moment, so building from git is the only thing that really worked <mark_weaver>homebrew has guile-2.0.9, but you need to pass --devel to the brew command. <foeniks>I think I told it to build from the git master <mark_weaver>several users have reported using guile-2.0.9 in homebrew without problems. if it doesn't work, I'd like to hear more details about why it doesn't work. <mark_weaver>there are also some stability problems on master at the moment. <foeniks>It might have had to do with me using snow leopard <foeniks>since xcode etc was not supported for snow leopard anymore which lead to troubles <foeniks>now that I run maverick I might then try guile-2.0.9 again <foeniks>for the time being things seem to work quite well <foeniks>in clojurescript, there were named lambda functions like (fn fn-name [x y z] body) <foeniks>is there a similar construct in scheme? <foeniks>I cannot remember seing one, gotta use letrec for this or (when applicable) named let fomrs <ijp>I think there was around r2rs, but it got dropped <ijp>there is a rec form in srfi 31, which is basically (rec x y) = (letrec ((x y)) x) <ijp>actually, that srfi is where I learned that there used to be a named lambda form <foeniks>do you have a preferred paste service here? <ijp>we prefer that you use one <foeniks>thats my simple named lambda function <foeniks>what is the benefit of `values` over returning a list? <civodul>it's more efficient (no heap allocation), and the callee can ignore some of the returned values <ijp>a questionable symmetry <civodul>ijp: in fact it's just a hack for simplistic compilers :-)