IRC channel logs

2014-09-21.log

back to list of logs

<Ulrar>Is there an existing procedure to get the first word of a string ?
<stis__>there is a regexp librray, but string-split might work
<Ulrar>I don't understand string-split. The example found on the net doesn't work : (string-split "/var/tmp/archive.tar.gz" "./" ) gives Wrong type argument in position 2: "./"
<Ulrar>In guile it's only with char delimiter maybe
<Ulrar>Ha, that's it. My bad
<Ulrar>So with guile-curl I post things to a rest service, and in return I get some json objects containing non ascii chars like é. Instead I get things like é, so I guess it doesn't return utf8 ? If so, is there functions to convert a string ? The only thing I could find on google was how to set encoding for files
<paroneayea>:) <bipt> the only winning move is not to reply
<wingo>Ulrar: link for guile-curl? usually that sort of thing is a library problem (failed to read response in the right character encoding)
<stis>cd
<wingo>Ulrar: the usual thing in guile is to use the built-in http stuff, though using https is a bit of a pain currently
<Ulrar>yeah, that's why I use curl
<stis>uops! sorry, anyway hej winfo:
<stis>errr wingo:
<wingo>Ulrar: guile-oath uses gnutls and it ain't too bad
<wingo>er
<wingo>oauth
<Ulrar>wingo: http://www.lonelycactus.com/tarball/guilecurl-0.2.tar.gz
<Ulrar>I'm using that
<wingo>cool, probably need to report a bug on it then
<Ulrar>According to the service's doc, it should be returning utf8
<wingo> https://github.com/aconchillo/guile-oauth/blob/master/oauth/oauth1/utils.scm#L112
<wingo>Ulrar: i would assume you're using guile 2.0, no?
<Ulrar>2.0.9 yeah
<wingo>yeah, then that means guile-curl has a bug i think
<wingo>it could be that the rest service you are using doesn't set the encoding headers correctly but that's less likely
<Ulrar>I'm not sure there is any headers, it's just json
<Ulrar>unless there is a special way of showing header with curl, didn't check
<wingo>all http responses have headers :)
<stis>wingo: how goes the hacking, working with day job or some new cool stuff in guile 2.2
<daviid>rlb: it would be nice to be able 'to tell debian' that a s/w is manually installed. i wonder if it would be possible
<muep>I would not be surprised to find that someone wrote a generator for an empty package with a given name and version
<rlb>daviid: in what context?
<rlb>muep: there is
*rlb forgets the name
<daviid>rlb: i need gnucash [for example] but manually installed guile-2.0 ...
<daviid>aptitude complains...
<rlb>equivs?
<daviid>yes, stable-2.0 from git
<rlb> https://packages.debian.org/sid/equivs
<daviid>installed in /opt of course
<daviid>ok, looking, tx
<daviid>i thought you asked equivalent versions ? :) nice name for a predicate :)
<daviid>rlb: i see you are a g-wrap admin... i will push, today, a merged patch with all I've done on the manual. then i'd like to update both the savannah page [to mention guile-cairo,...] and th g-wrap home manual pages: where is the web site hold, is it under git as well?
<rlb>daviid: umm -- ok, so I might be listed as an admin, but I haven't been involved with g-wrap in *many* years
<rlb>I should probably be removed from whatever list I'm on...
<rlb>(there)
*rlb has no idea what's going on wrt g-wrap these days
<daviid>that's fine, i understand, but do you know where the web site is, who can give me write access
<rlb>daviid: no -- but assuming the debian package is up to date, check the /usr/share/doc/PACKAGENAME/copyright file -- it should say.
<daviid>stupid quizz: how do we edit the savannah page? did I miss an edit buton somwhere or do we handle 'à la git' [which would be better
<daviid>will look, tx
<rlb> http://metadata.ftp-master.debian.org/changelogs/main/g/g-wrap/unstable_copyright
<rlb>or here: https://packages.debian.org/sid/g-wrap
<rlb>(link there)
<daviid>i can't find out where the home page 'source code' are handled
<daviid>the savannah guile-gnome page mention clearly where the web pages are, that they are still under cvs ...
<daviid>I can't find that info for g-wrap, don't you remember maybe ? :) sorry to bother you with that
<rlb>daviid: what is it you're looking for again?
<rlb>here's the savannah page: http://savannah.nongnu.org/projects/g-wrap/, but I have no idea if that's the current official location
<daviid>rlb: I know about the savannah page, tx. how do i change it? then where are the home web pages of g-wrap, who can give me write access ?
<rlb>daviid: yeah, no idea who's handling any of that now -- maybe wingo would know?
<rlb>I might also check the commit logs, and badger whoever's most recently prolific there?
<daviid>well i was hoping not to have to bother him with these details
<daviid>he's a project member, but not an admin [what ever that means on savannah by the way]
<rlb>I'm assuming you saw this, but http://www.nongnu.org/g-wrap/ looks like the homepage as far as savannah's concerned.
<rlb>(but presumably you meant you needed to figure out how that's changed)
<daviid>i have commit rights to source code, that is fine
<daviid>but i can't find the source code of the web site [the g-wrap home page savannah poiunts to]
<daviid>and i want to change the onlne manual html pages
<gjanssens>Hi
<gjanssens>I'm looking for a variant of scm_c_eval_string that allows me to evaluate a C string in the top-level module
<daviid>rlb: I'm sorry, I thought you'd know and answer immeditely, 'hey daviid, g-wrap web site is under git here, I'll give you write access now...'
<daviid>:)
<gjanssens>I found scm_eval_string_in_module which I could try as well
<gjanssens>However I don't know how to specify the top level module
<gjanssens>I'm trying to mimic the behaviour of scm_c_primitive_load but instead of loading a file, the scheme code is in a c string
<rlb>daviid: np -- I'm at least trying to figure out how the home page works, but wrt access, judging from the master commit log, you'll want to talk to either andreas or wingo. Even if I still have the authority(?), I shouldn't be messing with admin settings until/unless I become more involved again.
<daviid>rlb: i already have write access to source code
<daviid>rotty: could you tell me where the g-wrap website pages are maintained?
<daviid>rlb: I think, also, there should be 1 debian package only, not 2 [g-wrap or guile-g-wrap but not both] ... my 2c
<rlb>not sure, but I suspect the former is g-wrap, and the latter is the guile-wrapper sets for the former.
<rlb>but just a guess
<daviid>i don't think so
<daviid>it was the original idea but g-wrap only works and provides the functionality for guile
<daviid>i use g-wrap, i.e., for guile-gnome, guile-clutter..., not guile-g-wrap which is a kind of 'virtual package'
<rlb>daviid: possibly this? http://savannah.gnu.org/maintenance/HomepageUpload/
<daviid>do you personally have any contact with rotty ? He never answers, me at least, I hope he is fine
<daviid>ah looking, thanks!
<rlb>daviid: no -- not in a long while I don't think.
<daviid>i was hoping you were personal friends to get some news...
<daviid>anyway, i hope he's fine
<daviid>rlb: that sounds like what i needed, have to jump on another task now, but will look into that later, many thanks
<rlb>np
<mark_weaver>gjanssens: there's no singular "the top-level module". every module is its own module. separate, but equal.
<mark_weaver>gjanssens: scm_current_module () will return the "current module", which might be what you want.
<gjanssens>mark_weaver: ok, then I don't understand the documentation for scm_c_primitive_load
<gjanssens>It says the file will be read and evaluated in the "top-level" environment
<mark_weaver>gjanssens: if you know the name of the module you want to evaluate in, you could use 'scm_c_resolve_module' to the associated module object
<gjanssens>I want to call scm_c_eval_string the same way as scm_c_primitive_load
<gjanssens>Should I care about the environment then ?
<mark_weaver>generally speaking, the procedures that evaluate something use the current module, unless you specify otherwise.
<mark_weaver>so does scm_c_eval_string do what you want?
<mark_weaver>gjanssens: I guess you're under the impression that scm_c_eval_string doesn't do what you need, but I wonder why you think that?
<gjanssens>mark_weaver: I haven't tried yet, simply because the documentation of scm_c_primitive_load explicitly mention the top-level environment and scm_c_eval_string doesn't
<gjanssens>But you're right, I'll try first and come back if it doesn't work
<mark_weaver>they both use the top-level environment.
<gjanssens>thanks
<mark_weaver>which means the current module
<mark_weaver>(which is a fluid variable)
<mark_weaver>no problem, let me know how it goes!
<dmiles_afk>stis: configure.ac:10: error: required file 'build-aux/ltmain.sh' not found
<dmiles_afk>(that is upon automake --add-missing
<dmiles_afk>heh but configure is runing ..
<stis>did you do autoreconf firrst?
<dmiles_afk>yup
<gjanssens>mark_weaver: scm_c_eval_string does exactly what I need
<gjanssens>Thanks again for clearing that out
<stis>dmiles_afk: what tag did you check out?
<dmiles_afk> https://join.me/logicmooCorp
<dmiles_afk>ojk i thought maybe you said master was all good
<stis>latest tag should be stable, master is in hefty development atm, but of cause much more fun :-)
<stis>I'll checkout the repo and try to mirror your activity
<stis>I was able to reproduce the missing file problem. Added it to the repo from my developmen environment
<stis>dmiles_afk: ^^
<stis>just pushed it
<dmiles_afk>ok pulling
<dmiles_afk>guile-log is now building for me !
<stis>yey
<stis>watch out for any errors in the build, that would be helpful.
<stis>to know
<dmiles_afk>just warnings
<stis>and to be fixed :-)
<stis>my build mainly shows errors at memoize which is not ready yet and a few warnings
<stis>if you manage to install it do
<stis>(use-modules (logic guile-log iso-prolog))
<stis>,L prolog
<stis>at the prompt and you should be familiar
<stis>then it's trying out things in the manual.
<stis>for kanren, in stead use
<stis>(use-modules (logic guile-log kanren))
<stis>and then kanren (scheme lib) shouhld be workable
<stis>and if you like you can just do
<dmiles_afk> http://pastebin.com/y5UJnh6k
<dmiles_afk>(sorry i hadnt been wathing here.. now doing what you said
<dmiles_afk>*current-stack* is undefined
<stis>looks ok
<stis>aha first then do
<stis>(use-modules (logic guile-log)), does that help?
<dmiles_afk> http://pastebin.com/vx92prCv
<dmiles_afk>the iso-prolog sesm to be needd for the synatx
<stis>hmm, looks like you didn't use --prefix=/usr again or such no?
<dmiles_afk>i ddint since i still got the otehr to work via symlinking
<dmiles_afk>i'll do again this time with prefix
<stis>ok
<stis>you need the so synamic lib hooked in as well as the go and scm files
<dmiles_afk>there seems to be a cahse + site.. but dont know if there is more
<stis>you managed to compile guile log just fine though.
<stis>stis@lapwine:~/src/guile-log$ /usr/lib/guile/2.0/
<stis>ccache/ extensions/
<dmiles_afk>ls /usr/share/guile
<stis>did you get extensions as well symlinked in?
<dmiles_afk>i got becasue i got the guile dir
<dmiles_afk>oh actualyl.. i didnt copy the old well
<stis>ok
<dmiles_afk>i symlinked .. but didnt nesc get the stuff i hid out of the way back in well
<stis>yes, anyway you are close and there is a bit prolog that got run under the build process, so it's there.
<dmiles_afk>i am confident i am goign to get it running
<stis>:)
<dmiles_afk> (use-modules (logic guile-log))
<dmiles_afk>worked now
<dmiles_afk>now to add the sio-oproog?
<stis>then ,L prolog
<dmiles_afk>:) appy hacking with Prolog! To switch back, type `,L scheme'.
<stis>did you do (use-modules (logic guile-log iso-prolog)) ?
<stis>you can type .(use-modules ...) in the prolog shell
<stis>.help is also useful
<stis>as well as ,help that is the guile's standard env
<dmiles_afk>yup.. neeat.. now figuring out whats up with my sytnax
<dmiles_afk>am i in S-Expr mode or Prolog expre mode?
<stis>what does the prompt say
<dmiles_afk>well it started using more (y/n/a) > wrong input
<stis>type y or n or a, y=yes n=no a=all
<dmiles_afk>got cought ina reader issue and put several 10000s
<dmiles_afk>:)
<stis>yep it's unstable.
<stis>alpha alpha
<dmiles_afk>it all good.. hey and it wasnt in Sexpr-Mode was in prolog redaserer
<dmiles_afk>reader
<dmiles_afk>after ,L prolog it says: Happy hacking with Prolog! To switch back, type `,L scheme'.
<stis>cool, I need to poolish it alot, all reports about bugs and glitches are really welcomed
<dmiles_afk>no prompt after that but its reading currectly
<stis>yep, it's not the standard prolog prompt as you would expect. I try to follow the guile standard
<stis>you can do ,L elisp for example and the prompt changes just as the same
<stis>no prompt?
<stis>do you mean prolog standard prompt?
<stis>scheme@(guile-user)> ,L prolog
<stis>Happy hacking with Prolog! To switch back, type `,L scheme'.
<stis>prolog@(guile-user)>
<stis>thats what I have
<dmiles_afk>right not stadard prolgo prompt.. but that is fine
<dmiles_afk>thqat is what i hacve
<stis>cool
<dmiles_afk>my error is casues when i do a X=1.
<stis>anyway prolog is the programming language and guile-user is the current module
<dmiles_afk>prolog@(guile-user)> X=1.
<stis>rolog@(guile-user)> X=1.
<stis> X = 1
<stis>more (y/n/a) >
<dmiles_afk> http://pastebin.com/2fXKWzNc
<dmiles_afk>so it really is jsut the reader
<stis>yeu need to type a y, n or a
<dmiles_afk>yup, i never get that chance
<dmiles_afk>well i can type it now its waiting
<stis>ok, strange it got bombarded with key inputs that was working like return
<dmiles_afk>soem reason i am not blocking but returnin end of stream at you
<dmiles_afk>you then wonder whay you getting -1 or 0 or whichever the host system gives
<dmiles_afk>if i run in screen or soem other mode maybe my termional will blcok and wait for me to type
<dmiles_afk>liek if run . /dev/null first
<dmiles_afk>trying that
<stis>ok, maybe there is something I can fix in the repl code.
<dmiles_afk>yeah .. it might be competeing agaist the intial prlogo_read/N as well
<dmiles_afk>teh first reader never really yeiled the stream
<stis>maybe you need to install the readlib in guile
<stis>have you done that?
<dmiles_afk>but for now.. maybe if you printing what you got as part of the "wrong input" message
<dmiles_afk>nope.. ok doing that
<stis> https://www.gnu.org/software/guile/manual/html_node/Readline-Support.html
<dmiles_afk>this is a pretty virgin machine.. it always baffles me how little system it has
<dmiles_afk>but its kicked my butt a few times showing me all me dep assumtopions i dont tell users about ;)
<stis>:)
<dmiles_afk>awesoem yes.. that was all it was
<dmiles_afk>"The module is not loaded by default and so has to be loaded and activated explicitly."
<dmiles_afk>hwne i did those two lines.. it acts exactly how i expect
<stis>It’s a good idea to put these two lines (without the scheme@(guile-user)> prompts) in your .guile file.
<dmiles_afk>very great work.. i know its gettign late for you
<stis>yep, night time here, but it's fun that other find these things fun.
<stis>happy hacking!
<stis>and please report any issues (there should be many of them)
<dmiles_afk>yay i have readline app histopry now
<stis>yes
<stis>Hmm I should bail when readline is not installed, doing it that now
<stis>pushed!
<mark_weaver>wingo: kastrup is looking for a way to automatically detect when top-level macro keywords are referenced before they are defined, so they end up becoming normal variable references in the compiled code. any suggestions?
<mark_weaver>his idea was that maybe there's some residue in the module system left over when the not-yet-keyword identifier is looked up.
<mark_weaver>basically, he'd to like to rig defmacro so that it calls attention to previous attempts to look it up.
<mark_weaver>I guess we could modify the macro expander to make a record every time it tries to access a top-level that could have been a macro reference.
<wingo>is this because lilypond users embed scheme code but that code uses macros that may not be available, for whatever reason?
<wingo>or what's the deal
*wingo missing context; pulling mail to see
<mark_weaver>well, my understanding is that guile 1.8 expanded macros lazily, so it was sufficient for them to be available before the first time a given expression was evaluated. is that right?
<mark_weaver>so, for example, in 1.8 it was okay for the body of a procedure to use a macro that isn't defined yet at the time of the procedure definition, as long as it's defined before the procedure is first called.
<mark_weaver>whereas 2.0 is more strict about that.
<mark_weaver>wingo: you won't find it in email. it's in my private email.
<wingo>ok -- i still have my previous concern about incidental vs essential details, then. hard to help without context
<wingo>and it seems to me that if it's just a question of embedded scheme in user code, then local-eval should be sufficient
<wingo>but i don't know the context, so dunno much more
<mark_weaver>forget about that other problem, they have an acceptable workaround.
<mark_weaver>so in 1.8, the equivalent of (define (foo) (bababa 50)) (define-syntax-rule (bababa x) (quote x)) would work, but now it doesn't.
<mark_weaver>so david is looking for something to help him discover this class of problem.
<wingo>in guile 1.8, any toplevel, bound or unbound, might be a macro.
<wingo>e.g. (define f (lambda () (g)))
<wingo>i don't think g is memoized until f is run first
<mark_weaver>right, and if you evaluate the equivalent of what I wrote above in 1.8, then later call (foo), it works, because the (bababa 50) is lazily expanded.
<wingo>so g could be bound but then later rebound and the macro-ness of g can change (either way)
<mark_weaver>whereas in 2.0, that 'bababa' gets turned into a procedure call, which later complains at run time about trying to apply a macro as a procedure.
<wingo>so "the set of toplevels which may be macros" == "all toplevels"
<wingo>at least in guile 1.8 semantics
<mark_weaver>right, but in 2.0, if 'g' is a macro, it has to already be bound at the time that (lambda () (g)) is expanded.
<mark_weaver>or else it will be assumed to be a normal procedure call.
<wingo>so the question is how to implement the guile 1.8 semantics in guile 2.0? or is it more narrow than that
<mark_weaver>well, for now we're just looking for a way to detect forward references to macros.
<mark_weaver>so, if (lambda () (g)) is expanded and 'g' is later bound to a macro, it should raise an alarm.
<mark_weaver>I'm sure I can figure out something, but I was just curious if you had any clever ideas of how to do this relatively easily.
<mark_weaver>specifically: david wants 'defmacro' to issue a warning if the keyword binding has already been referenced by previously-expanded code and assumed therein to be a normal procedure.
<wingo>ah, i see, makes sense to me.
<wingo>seems you could detect this case by hooking into get-global-definition-hook
*mark_weaver looks
<wingo>how to store that list of identifiers, dunno -- any identifier that doesn't have a resolved variable at all could be added to a set, along with the current module; that set could be accessible via a parameter
<mark_weaver>makes sense, I'll look into it. thanks!
<wingo>thank you :-))
<zacts>are macros in guile similar to SBCL Common Lisp macros? or is it a totally different beast?
<taylanub>zacts: Scheme supports hygienic macros, and it's best to use them. Guile also supports `defmacro' but that's quite discouraged.
<zacts>ah ok
<wingo> https://gitorious.org/guile-present/guile-present, http://wingolog.org/pub/example-presentation-slides.pdf
<wingo>night folks
<wingo>hoo, a couple of rendering bugs there
<wingo>anyway, things to fix :)
<janneke>night!
<zacts>mark_weaver: hey dude
<zacts>I was curious, have you ever tried programming Common Lisp?
<mark_weaver>hi zacts
<mark_weaver>I did some work on Maxima, which is written in a subset of CL.
<zacts>oh interesting
<richi235>jep it's one of the few programs which uses the GNU CL implementation
<mark_weaver>Maxima can work with several CL implementations, and gcl is indeed one of them.
<mark_weaver>(and the one that I used, as I recall)
<zacts>I feel like we need more practical tutorials for scheme.
<mark_weaver>definitely true
<zacts>I've been reading Practical Common Lisp lately, and I feel it would be nice to have one for scheme
<zacts>many scheme texts, such as SICP, are extremely abstract and academic, although they are great.
<zacts>but, sometimes a person new to a language wants practical everyday examples
<mark_weaver>I agree that it would be a very useful thing to work on.
<zacts>perhaps I'll take notes as I learn more about scheme, and stuff. If I can organize them, perhaps it would be helpful to others.
<zacts>but, it would be nice to see the scheme / guile community get involved with providing something like this.
<zacts>also, providing a walkthoughs for code, and why certain abstractions were designed in the way they were would be nice too. (something like the Minix book or 4.4 BSD design book, but for guix/guile/guilemacs/etc..)
<zacts>anyway, I'll bbl.
<mark_weaver>Mike Gran started something called "The Guile 100 Programs Project", and did a few, but got distracted I guess.
<mark_weaver> http://www.lonelycactus.com/guile100/
***micro is now known as Guest91815
<mark_weaver>I solved scores of Project Euler problems and Google Codejam problems in Guile. Maybe I should publish some of that.