IRC channel logs

2016-04-03.log

back to list of logs

<paroneayea>davexunit: one curious aspect of haunt is that it's assumed that there's only one source of posts
<paroneayea>which maybe for now is the right thing
<davexunit>yeah the posts database is a single thing
<davexunit>what use-cases do you have in mind?
<paroneayea>davexunit: I don't have any actually! I just was trying to figure out how it knew what collection of posts specifically the user had
<paroneayea>and then I realized there would only be one collection
<paroneayea>which is a-ok :)
<paroneayea>davexunit: I'm not sure (reading this) that the prefix option supplied for the blog builder is also made available for the atom builder
<paroneayea>I'll test, possibly that'll mean a patch incoming :)
<paroneayea>8sync site is finally coming together
<paroneayea>it's nice
<davexunit>paroneayea: yeah I think the atom feed generator is lacking that
<davexunit>would love a patch for it
<paroneayea>I don't understand how to update sites on http://gnu.org/s/8sync/ and similar foo
<davexunit>paroneayea: push to a cvs repo :(
<paroneayea>maybe I should use 8sync.io since I have it. But I seem to remember mark_weaver telling me that .io is fairly evil.
<paroneayea>davexunit: do you have examples of the scheme syntax highlighter in action somewhere?
<paroneayea>I'd like to use it
<mark_weaver>paroneayea: I don't think it was me. I don't know much about .io one way or the other
<davexunit>paroneayea: yeah, one sec
<davexunit>paroneayea: https://git.dthompson.us/blog.git/blob/refs/heads/haunt-migration:/skribe-utils.scm#l26
<davexunit>er
<davexunit> https://git.dthompson.us/blog.git/blob/refs/heads/haunt-migration:/skribe-utils.scm#l18
<davexunit>a more simple example:
<davexunit>(highlights->sxml (highlight lex-scheme "(lambda (x) (+ x 1))"))
<davexunit>'highlight' accepts a lexer procedure and a string or a port to read from.
<davexunit>it returns a list of highlighted tokens, where a token is either a string containing just whitespace or a two-element list whose car is a symbol that identifies the type of lexeme (string literal, identifier, keyword, etc.), and whose cdr is the corresponding source code fragment
<daviid`>rain1: hello. the example you pasted wrt gir, did you actually came to make print-attribtes working? I mean it doesn't fail as in raising an exception, but it always return 0, hence does not display any attributes. I'm facing a similar problem with my 'model', hence my quizz
<mark_weaver>paroneayea: regarding the geiser bug, if there won't be a release soon, maybe we could backport jaor's "moving the code around" fix and include it in guix for now?
<mark_weaver>or maybe there's some other easier workaround, dunno
<davexunit>I have a package expression that uses a recent geiser git commit https://git.dthompson.us/guixsd.git/blob/HEAD:/profile.scm#l36
<davexunit>haven't checked if it contains the fix paroneayea is after
<davexunit>I use this git version because it contains Guile 2.2 compatibility
<mark_weaver>davexunit, paroneayea: I might work on finishing up davexunit's JSON module for Guile. Can you remind me what API changes you were thinking about making compared with https://lists.gnu.org/archive/html/guile-devel/2015-08/msg00003.html ?
<daviid>paroneayea: wrt gnu webpages, if you click on the 'Source Code Manager: CVS Repository' of yout gnu/8sync savannah page, you get an explanation how to checkout the cvs repo, then uou can cvs add *.html, images..., then cvs commit -m 'my commit msg'
<mark_weaver>davexunit: hmm, okay. maybe we really need to push for a geiser release then :)
<daviid>paroneayea: we all maintain our webpages else where, using sxml and git, then copy html and images/icons to the gnu cvs repo then commit...
<davexunit>mark_weaver: wrt json, I've been thinking about some potential syntax changes
<daviid>guile-web even has a script to do that I think, but i do it manually for my still small projects
<davexunit>mark_weaver: if you remember back, there was some discussion of whether to use strings or symbols as JSON object keys.
<mark_weaver>davexunit: yes. what are you thoughts on that? if JSON object keys can only be strings (and not anything else, e.g. null), then I guess symbols would be fine.
<davexunit>I think that symbols would be best
<davexunit>yes, JSON keys *must* be strings
<mark_weaver>paroneayea: what do you think?
<mark_weaver>davexunit: okay, in that case there's no ambiguity, so I see no problem off hand.
<davexunit>mark_weaver: my other thought is that, if we use symbols, we can identify a JSON object without the special '@ sentinel
<mark_weaver>I guess it's about what works best in practice, and you and paroneayea would know best about that.
<davexunit>yeah, I mean it's nicer in Scheme to use symbols when quoting/quasiquoting
<davexunit>'((foo . 1) (bar . "hi")) better than '(("foo" . 1) ("bar" . "hi"))
<davexunit>I'm sorry I've left this patch just sitting on the floor for so long.
<mark_weaver>davexunit: hmm, I'm not sure that's right. without the @ sentinel, ((null 5) (foo 6)) could either be an object or an array containing an array starting with null, right?
<mark_weaver>ah, I forgot the dots. hmm, does that make a difference?
<mark_weaver>I guess it could still be an object where the values are arrays
<davexunit>mark_weaver: yeah, that's a potential point against that idea.
<davexunit>yeah
<davexunit>that's valid
<davexunit>I think paroneayea wasn't a fan of '@, so I was trying to think of ways around it.
<mark_weaver>were any other API changes under consideration?
<davexunit>I don't think so, but paroneayea might have something in mind that I forgot or he hasn't yet mentioned.
<mark_weaver>I suppose JSON arrays could be represented as scheme vectors
<mark_weaver>but that's a slight pain too
<davexunit>Racket does this
<davexunit>but I didn't like it from a usability standpoint
<mark_weaver>I can certainly see the appeal being able to treat a JSON object as an alist without using cdr
<mark_weaver>anyway, I have to go afk for a while. ttyl!
<davexunit>mark_weaver: bye!
***M-TimePath is now known as TimePath
<androclus>hey, all.. is this the place to ask a quick silly coding question (i am just learning guile) (?)
<androclus>i will go ahead, but slap me if inapprop.. :P
<androclus>suppose i have:
<androclus>(define a 'right)
<androclus>and
<androclus>(define (atom? x)
<androclus> (if (not (defined? (quote x)))
<androclus>my intention is that if i run (atom? a) i should get #t back because it is defined
<androclus>but if i run (atom? b) back, i should get #f because b is not defined
<androclus>but instead, for (atom? a), i get #f
<androclus>and for (atom? b), i get error unbound variable: b
<androclus>so i am missing something basic but obvious, i think
<androclus>?
<androclus>because, if i run, outside of a function, (defined? (quote a)), i do get #t
<androclus>and if i run (defined? (quote b)) , again, outside of a function, i do get #f (and no error message)
<androclus>so what does putting it inside a function do differently?
<paroneayea>davexunit: oh thanks for the link
<paroneayea>davexunit: I'm a fan of @
<paroneayea>in json
<paroneayea>I'm not a fan of symbols-only as keys :)
<paroneayea>I think strings supported as keys is important
<paroneayea>I also preferred (@ ("key" "val")) to (@ ("key" . "val"))
<paroneayea>because I don't like what happens when you do
<paroneayea>(@ ("key" . ("list" "of" "items")))
<paroneayea>and then pretty-print it
<rmrfroot>is there a function to intercalate a list of strings with a delimiter?
<rmrfroot>for example if I have a list of path segments and join the segments with "/" between each segment
<wingo>string-join
<fhmgufs>How can I access a dialog's content area in guile-gnome? I can neither find the get-content-area method nor a slot bound to that vbox.
<wingo>rmrfroot: ^
<fhmgufs>Oups, sorry for interrupting :)
<fhmgufs>But I really would like to add some widgets to my dialog.
<rmrfroot>wingo: thanks :)
<kristofer>good morning!
<rain1>good morning!
<janneke>good morning!
<rain1>davexunit, I think that print-attribtes works.. it's just that nothing has any attributes. the same happens in C
<rain1>I don't know where to find any objects that do have attributes to test it properly on
<kristofer>I'm working on a web app.. slowly but surely. anyway, I run 'guile site.scm -e start-server --listen' and my app is up and serving requests, but there's no repl on port 37146
<kristofer>is it a threading issue? I'm ignorant here.. how might I get an repl to my running service?
<rain1>what if you pass in a port too ? --listen=37146
<kristofer>rain1: I've tried specifying the port as well
<kristofer>got it!
<kristofer>the --listen argument needed to be first, as in: 'guile --listen site.scm -e start-server
<cojy>is there a "best" json library for guile?
<davexunit>cojy: guile-json is what's available now, but we are working on a JSON module for Guile core.
<janneke>ACTION cheers
<fhmgufs>daviid: How can I access the content area of a guile-gnome dialog?
<fhmgufs>I can neither find the get-content-area method nor a slot bound to that vbox.
<daviid>fhmgufs: do you use glade?
<fhmgufs>daviid: No.
<daviid>fhmgufs: I use glade and the glade interface to grab the widget I need, so i don't grab the content nor the action area, i'd have to look how to do that fromthe source
<fhmgufs>Ok, I wonder why guile-gnome has so much modified methods.
<daviid>what do you mean?
<fhmgufs>There are a lot methods not available.
<fhmgufs>Maybe for a reason, I don't know.
<fhmgufs>But it doesn't matter, until now I got done everything I wanted to.
<daviid>fhmgufs: generally it is because these would require a special wrapper and nobdy wrote them yet, but it could be a bug as well, so feel free to shout :) on a per method base, then I can check and let you know
<fhmgufs>Ok, if I see the next one I'll shout :)
<daviid>but if you manually build the dialog, you must have written a vbox and used add ... so you should 'have it', no?
<fhmgufs>daviid: No, the vbox is contained by the dialog. (i.e. its content area)
<fhmgufs>You can't just call add because of the additional action area below (containing the buttons).
<fhmgufs>daviid: In C there's the method get-content-area, which is missing in guile.
<daviid>looking now
<fhmgufs>daviid: For example gtk-tree-model-get-iter-from_string isn't available. You have to manually run (get-iter model (gtk-tree-path-new-from-string path path))
<fhmgufs>Well, actually it's (get-iter model (gtk-tree-path-new-from-string path)) now, thanks :)
<daviid>fhmgufs: wrt to your previous goops related quizz, you have to specialize [write] an initialze method for the class of which you want to see if the user used keywords ... they are good examples for this in grip-clutter
<daviid>fhmgufs: welcome
<daviid>fhmgufs: here is an example http://git.savannah.gnu.org/cgit/grip.git/tree/grip/clutter/box.scm
<fhmgufs>Ok, tanks!
<fhmgufs>Oups :P
<daviid>line 78 and below... the reason I do this is because unlike clos and goops, gobject does not allow other keywords, and virtual slots does not exist in gobject ...
<fhmgufs>Ok, thanks, and how can I use my poor dialog?
<daviid>fhmgufs: look in the manual for let-keywords, and use (let-keywords initargs #t [or #f] ...
<daviid>fhmgufs: but you have the widgets of the content area and the action area right?
<daviid>not sure i understand you here, what do you mean 'use the dialog'
<daviid>?
<fhmgufs>I want to pack-start some widgets to the content-area being a internal <gtk-vbox> of the dialog.
<fhmgufs>But for adding them I need to get that first. In C I would have done it using the get-content-area method.
<daviid>ah ok i see, so i never had to do this because i use glade
<daviid>let me see if i can get these 2 method to work
<daviid>we don't have bindings because there were added in 2.14 and as it is, we bind 2.10
<fhmgufs>And how could you ever add sth to the dialog then?
<daviid>in the mean time, there must be a way to parse the children of the dialog
<fhmgufs>An other way (maybe the pre-2.14 way) was to directly access the vbox using dialog->vbox in C.
<daviid>something in the example maybe? our examples...
<daviid>fhmgufs: http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/gtk/examples/guile-gtk-demo/demos/dialog.scm
<daviid>fhmgufs: the example uses (pack-start (get-vbox dialog) hbox #f #f 0)
<fhmgufs>Ah, that's cool.
<fhmgufs>Thanks.
<daviid>try (get-vbox dialog)
<daviid>for the action area use (add-button dialog ...
<fhmgufs>This is the list of missing functions for dialogs: gtk-dialog-new-with-buttons, add-buttons, get-response-for-widget (since 2.8), get-widget-for-response (since 2.20), get-action-area (since 2.14), get-content-area (since 2.14), set-alternative-buttton-order (since 2.6), set-alternative-buttton-order-from-array (since 2.6)
<daviid>fhmgufs: but if you are really serious wrt gule-gnome :), which seems to be the case, I would seriously consider doing the design of your apps using glade [you'd have to grab an old version but that's easy. there is a learning curve but imo worth it
<fhmgufs>Ok, so I'll maybe do that, but I liked it so much, that you just could run (make <asdasdasd> #:a-lot-of-cool-properties) and pack -> ready.
<daviid>ok will look into these. response type are in, look in the example i pasted
<daviid>add-button is in [no 's' at the end
<fhmgufs>Are there plannings for porting guile-gnome to gir?
<fhmgufs>daviid: add-buttons is another function.
<fhmgufs>But you don't really need it.
<fhmgufs>The only important ones from that list are the last two and the response-for / for-response ones.
<fhmgufs>I read sth about guile-gir, but this project isn't alive, right? Wouldn't it be simple in scheme to have a dynamic gobject-introspection typelib front-end?
<daviid>fhmgufs: not that simple, and before it reaches the quality of guile-gnome as we have it, it will take 1 to 2 years
<fhmgufs>daviid: Ok, you're right, guile-gnome is good enough!
<fhmgufs>Thanks for your help!
<daviid>guile-gnome is a master piece of proper integration between gobject and goops, it is very stable and has everything to build ver nice interface [see GNU Foliot], and till we have gtk3, it is worth investing using it, imo
<fhmgufs>You're right.
<daviid>if i had time i'd build a guix gui using it, but i'm working on a gir binding [as i said it will take 1 to 2 years before it reaches the quality of the actual guile-gnome]
<jmd>I thought that goops was deprecated.
<daviid>jmd: :) thanks god, it wll never be deprecated
<daviid>and if, but that will not happen, i'll maintain it
<fhmgufs>How can I test whether a list contains only one element?
<daviid>(null? (cdr my-list))
<fhmgufs>Ok, thanks!
<rain1>you might (define (singleton? list) (and (not (null? list)) (null? (cdr list))))
<daviid>rain1: hello. did you see my quiz, yesterday?
<rain1>oh yeah i did
<rain1>I don't know where to find any objects that do have attributes to test it properly on
<rain1>I think that print-attribtes works.. it's just that nothing has any attributes. the same happens in C
<daviid>rain1: ok, thanks
<rain1>sorry davex i replied to you instead of daviid about that by accident
<cojy>fhmgufs: i would use (= (length x) 1)
<rain1>that's slow on long lists
<cojy>doing (cdr my-list) will blow up if it's empty
<cojy>oh you're right good point!
<fhmgufs>The list can't be empty, so nothing is going to blow up! :)
<stis>I just growed my beard. My prolog vm interacting with the guile vm starts executing.
<dmiles>it is a neck-beard
<jmarciano>I would like to make lambda that creates a new lambda based on argument, is that possible?
<madsy>jmarciano: A function returning a function? Sure.
<jmarciano>yes like to make (fun abc "this") and that would make (abc) => "this" for example
<cojy>what about (define abc (fun "this"))
<cojy>or .. (define (abc) this)
<jmarciano>I am beginner and I cannot see there how to dynamically build function
<jmarciano>I am thinking something like this: (define command (lambda(c) (lambda() (system c))))
<cojy>that works
<cojy>then you could do (define ls (command "ls"))
<jmarciano>is there possibility that I do (command "ls") ?
<jmarciano>as otherwise I could do (define ls (system "ls")) and it makes no sense, right... :-)
<jmarciano>first I was thinking this would work: (define command (lambda(c) (define c (lambda() (system c)))))
<jmarciano>but I get: no expressions in body in form
<cojy>why does it make no sense?
<jmarciano>as then I don't need it, I can use system directly
<cojy>you definitely could, i would recommend it
<cojy>though it could be possible you want to do other things under command later like wrap the system call with a sandbox
<jmarciano>I wish to learn how to make function that makes new functions.
<jmarciano>not that I need system calls, I need to learn ^
<cojy>well want you want to do is define a name from a string, but this isn't really a thing people do or like in scheme
<jmarciano>if you know how?
<jmarciano>(define command (lambda(c) (lambda() (system (string->symbol c))))
<jmarciano>thank you, you gave me the clue, was it intentional?
<jmarciano>but well this also is not working well
<rain1>you want to do this
<rain1>?
<rain1>(define ls (command "ls"))
<jmarciano>no
<rain1>(define uname (command "uname"))
<rain1>and then be able to go (ls) (uname "-a")
<jmarciano>I want to be able to (fun "here") and that I can later do (here), so that the previous creates new function.
<rain1>you can't really do that
<jmarciano>I assumed that can be done in scheme
<rain1>(let ((here (fun "here"))) ... (here) ...) is ok
<jmarciano>that I don't get what you mean