IRC channel logs

2016-03-06.log

back to list of logs

<paroneayea>wingo: I am hitting an opaque error in compiling my attempt at merging
<paroneayea> http://pamrel.lu/7d8f9/
<paroneayea>any way to get it to give me more info?
<paroneayea>ice-9/eval.go is not one of the files changed, but I guess it's affected by whatever happened
<paroneayea>wingo: I could also push up my attempt at merging so far if you'd be interested in looking at it
<janneke>paroneayea: what about
<janneke>configure: --disable-silent-rules verbose build output (undo: "make V=0")
<janneke>
<paroneayea>janneke: trying, thanks!
<janneke>so that would be: make V=1 or --disable-silent-rules
<paroneayea>janneke: thanks, trying
<janneke>hth --- zZzz
<paroneayea>wingo: so here is my naive attempt at a merge, if you're curious... git@gitlab.com:dustyweb/guile.git bipt-elisp-wip branch
<paroneayea>it doesn't compile, for the same reasons listed prior, but I've been unable to get it to give me a clearer warning message
***autogen is now known as aleogen
<paroneayea>crossposting from #guix: gave a live demo of guile-emacs AND Guix at the emacs hackathon!
<daviid>paroneayea: well done!
<paroneayea>john wiegley said "*that's* guile emacs??" when he saw it booted up, surprised
<paroneayea>he seemed very enthused by the demo
<paroneayea>so did many others
<daviid>very good!
<rekado>paroneayea: very cool!
<rekado>do you know if we have a bug tracker for guile emacs?
<rekado>it fails to start for me (with a segfault) when desktop-save-mode is active.
<janneke>ACTION wonders what was the surpise behind "*that's* guile emacs??"
<janneke>ACTION missed the demo...
<thetan>Hello I am learning Guile, maybe someone can help me... Trying to test command line argument and multiply it.
<thetan>I use script with: #!/usr/bin/guile -e main -s !#, later it comes: (define kg (cadr (command-line)))
<thetan> (display (kg)) -- so this works, I get the command line. But what to do if (command-line) has no arguments? Can someone direct me?
<thetan>but if I want to make (display (* kg 1000)) it does not work.
<ArneBab>thetan: (if (null? (cdr (command-line)) do-something)
<ArneBab>thetan: and string->number should help
<thetan>thank you ArneBab, let me see
<ArneBab>null? tests if a list is empty
<thetan>(if (null? (cdr (command-line))) (quit))
<thetan>(display (cdr (command-line)))
<thetan>I have got it working like this. Thank you much.
<thetan>Where in the Guile docs I find definitions of cdr and cadr ?
<thetan> http://www.gnu.org/software/guile/manual/guile.html <-- I am reading, but hard to find.
<janneke>thetan: in Emacs type: i cdr RET
<thetan>i is undefined, says Emacs
<janneke>sorry; go to info mode: C-h i
<janneke>then, go to the Guile manual: m Guile Reference RET
<janneke>...then type: i cdr RET
<thetan>I got it, car displays the first part of the pair, cdr the second part of the pair.
<thetan>This works: (define kg (cadr (command-line))), and I get kg to be for example 2. But after that, this does not work: (display (* kg 1000))
<janneke>thetan: kg is a string; try: (string? kg) or (number? kg)
<janneke>string->number
<janneke>oop... is what you may want
<thetan>number? is test?
<janneke>yes, the `?' suffix is conventionally used as a test
<thetan>aha kg is string because of cadr?
<janneke>what used to be `-p' suffix in lisp
<janneke>kg is string because of (command-line): it returns a list of strings
<thetan>(define kg (string->number (cadr (command-line))))
<thetan>I got it working now. Does that mean that command line arguments are all strings automatically?
<thetan>aha yes yes
<janneke>:-)
<janneke>guile has strict typing, but does not (yet) have static typing [using the terms loosely]
<thetan>(define grams (* (string->number (cadr (command-line))) 1000))
<thetan>Now I get grams, if input are kilograms.
<janneke>thetan: if you lookup command-line (i command-line) in the docs...
<janneke>it talks about list of strings
<thetan>On that page, only thing I see is: -- Scheme Procedure: command-line
<thetan>I see the page, (program-arguments), etc. but regarding (command-line) I don't see a reference
<thetan>Does that mean: command-line is same as program-arguments?
<thetan>because it works.
<janneke>yes, it's the same
<janneke>/me is looking at the first index reference: 7.2.6 Runtime Environment
<janneke>
<thetan>aha I get it. Where do I find reference to display just 2 decimals instead of many?
<thetan> http://www.gnu.org/software/guile/manual/html_node/Numbers.html#Numbers tried looking here, but not finding...
<janneke>you want to look at (format)
<thetan>aha
<thetan>(define xau (format #t "~$" (/ grams troy))) -- got it working like this.
<thetan>I just need to replace commands in my mind from Perl to Guile
<ArneBab>thetan: command line arguments are strings, because that’s how inter-process communication is defined in POSIX.
<thetan>Thanks ArneBab. I see.
<janneke>ArneBab: doesn't perl treat strings like numbers and vice-versa?
<thetan>yes
<ArneBab>I know that javascript does that
<janneke>if you have sloppy-typing, you would never discover that :-)
<thetan>Only now I get result: 32.15#t instead of 32.15
<janneke>ACTION wonders why guile doesn't do static type checking, though
<ArneBab>thetan: what do you get with (format #f …)?
<thetan>#f -- did not get it in first, now yes!
<thetan>But that means I converted 32.15 to string.
<ArneBab>thetan: that’s for the target of the format
<ArneBab>thetan: yes, that’s what format does
<thetan>I was thinking to use it still as number, but OK.
<thetan>Which postgresql module is standard to be used? I tried with:
<thetan>(use-modules (dbi dbi))
<thetan>Or shall I use guile-pg?
<janneke>thetan: something like: (/ (truncate (* 100 3.1415)) 100)
<thetan>truncate is good, only it rounds number rather, than showing 2 decimals for example
<thetan> http://pastebin.com/0rMBNPZa -- I am learning.
<yuqian>Hi everyone. In the manual, some procedures are described as this: build-request uri [#:method='GET]......
<yuqian>I want to know how can I use the procedure and change the default method to POST ?
<janneke>yuqian: it is not as simple as (build-request uri #:method 'POST)
<yuqian>Thank you .
<thetan>How do I get pwd or current directory in guile?
<amz3>thetan: https://www.gnu.org/software/guile/manual/html_node/Processes.html#index-getcwd
<thetan>oh, thank you, I was searching in guile> ,apropos pwd and such, did not try cwd, alright thanks.
<thetan>I find the built-in documentation very very good with ,describe getcwd
<janneke>thetan: i pwd in emacs info would have helped you...
<thetan>ok let me see
<thetan>yes, it finds getcwd and other stuff in emacs. thanks
<amz3>janneke: thanks for the tips, now I'll try to remember it
<amz3>I can write it in my .emacs :)
<amz3>a search-guile-doc procedure would be even nicer
<thetan>by which procedure can I cut string from certain position?
<thetan>As there are many: http://rcdrun.com/images/upload/tmp/2016-03-06-14:13:15.jpg
<amz3>thetan: string-drop
<thetan>alright
<amz3>small question what are you using as feed reader?
<thetan>It took me some time, but it is beautiful feeling with scheme. I converted simple Perl script to Guile, from: http://pastebin.com/R8ygiF7U to http://pastebin.com/W2gTJ2PJ
<thetan>well not quite, but almost there
<thetan>is there some equivalent to shift from Perl? Like to remove first member of list
<amz3>thetan: list-drop
<amz3>thetan: that said, removing the first element of a list is simply cdr
<thetan>no list-drop on my side
<thetan>GNU Guile 2.0.11. I think of using (cadr (cadr (program-arguments)) instead
<amz3>thetan: it's called list-tail sorry
<amz3>thetan: usually people use `ice-9 match` to match program-arguments output
<thetan>aha
<amz3>instead of destructuring manually the arguments
<thetan>but Ok I must learn first without it
<thetan>(if (eq? (cadr (program-arguments)) "link") (display "Match"))
<thetan>this one is not working, if I: program link
<thetan>and I wonder why
<janneke>thetan: it's unusual to modify lists (like shift) in scheme
<janneke>thetan: you may want to something like
<janneke>(let* ((lst the-list) (head (car lst)) (tail (cdr the-list))) .. work with head and tail)
<thetan>that looks feasible, though too steep gradient for me. I must verify why eq? is not working
<thetan>(cadr (program-arguments))
<thetan>$2 = "link"
<thetan>(eq? (cadr (program-arguments)) "link")
<thetan>$3 = #f
<thetan>hard to understand why is it false
<jlicht>thetan: eq? is not the procedure you're looking for ;-)
<jlicht> https://www.gnu.org/software/guile/manual/html_node/Equality.html
<thetan>so it tests for type of objects, not its values.
<jlicht>tldr; eq? looks at the actual objects, and the strings you are comparing are not the same object
<jlicht>caveat emptor, because for numbers and characters it does look at just the value if I'm not mistaken
<thetan>(eqv? (cadr (program-arguments)) "link")
<thetan>$15 = #f
<thetan>yet false
<artyom-poptsov>thetan: You should use 'string=?' predicate to compare strings.
<jlicht>thetan; also, it is eqv? that looks at the value of numbers and characters as well. eq? is not really useful for those
<thetan>Oh yes
<thetan>thank you yes,
<ArneBab>thetan: just use equal?
<ArneBab>that’s the more generic one
<ArneBab>(and much easier to read)
<thetan>aha
<thetan>,describe equal
<thetan>While executing meta-command:
<thetan>ERROR: No variable named equal in #<directory (guile-user) 1a99c60>
<thetan>so I don't have equal
<thetan>but I got it with string=?
<janneke>thetan: you have "equal?" ;-)
<thetan>that yes yes
<thetan>how do I test for number of elements in the list?
<amz3>length
<thetan>oh yes thanks amz3
<thetan>already replaced 2 local Perl scripts with guile.
<stis>civ
<stis>sneek: later tell civodul there is a new match.scm in the chipi repo that fixes a bug reported here on irc regarding named match-let
<stis>oh sneek is gone
<stis>darn
<amz3> :/
<paroneayea>janneke: mostly amazement that it could do as much as it could, and looked like normal emacs
<paroneayea>ohhhhh
<paroneayea>I might have fixed the error preventing the successful merge
<paroneayea>OOH
<paroneayea>I got bipt's elisp branch running on top of current git master!
<holomorph>\\o/
<janneke>paroneayea: yay!
<janneke>paroneayea: got your email, that answered my questions!
<thetan>searching for guile email module, is there something lke that? Mime, attachments, text, html?
<janneke>thetan: some solutions were posted to the guile-user list
<janneke>ACTION hopes for ArneBab & guildhall to address this...
<thetan>ok let me search
<janneke>paroneayea: aiui the biggest hurdle is to find a good way of pre-compiling/caching .el -> .go?
<janneke>and prolly much work to do with getting all tests to pass...
<paroneayea>janneke: I don't think the compiling part is too hard, probably someone just needs to do that part, but the mechanisms are all there
<paroneayea>optimizing the elisp stuff on guile's end and then working hard to make all the tests pass on the guile-emacs branch are probably the hard steps
<paroneayea> https://www.emacswiki.org/emacs/GuileEmacs#toc8 https://www.emacswiki.org/emacs/GuileEmacsTodo
<thetan> janneke: thank you, I found mailutils
<thetan>anyone knows guile-pg?
<thetan>I wish to check for type...
<janneke>paroneayea: i don't see the .elc/.go upstart in that list?
<janneke>user visible issue 1. would be the one thing I'd dare to look into
<janneke>oh I see, .elc/.go is nr 2
<thetan>I am searching for templating system where guile can be embedded in the text? Possible? Also searching for guile based markdown.
<paroneayea>wingo: ping for discussion on what should be done to get elisp support into master, now that it's rebased on top of guile master
<paroneayea>if you have time / interest in discussing it (briefly) today!
<paroneayea>as far as I can tell there are maybe two blockers to it being merged
<paroneayea>1) the most recent unmerged commits aren't ChangeLog style.
<paroneayea>2) the most recent commit disabled 3 tests, and presumably those should be re-enabled after fixing?
<paroneayea>thetan: you might want Skribilo
<paroneayea>thetan: and also there was a guile-markdown thing posted to the guile-user mailing list recentlyish for the potluck I thinnnnnk?
<thetan>paroneayea: thank you, I found one: https://github.com/hoedown/hoedown/issues/190 but supports deprecated version, so I will see what to do.
<paroneayea>thetan: https://github.com/OrangeShark/guile-commonmark
<rain1>are you using artanis?
<amz3>rain1: yes
<rain1>i meant thetan
<rain1>because it has a thing for templating
<janneke>ACTION wrote something for templating
<janneke>artanis does templating?
<amz3>rain1: I answer nonetheless, I don't use artanis templating
<janneke>hmm, would be nice to use/create a common implementation
<rain1>is it bad?
<paroneayea>if it's for html'ish things, sxml with quasiquote is quite nice :)
<amz3>dunno :)
<amz3>I don't use the template language because I started with sxml without artanis and move to artanis without converting the template since it was good enough
<thetan>I looked at Scribilo, is not quite what I was thinking. I think simply templating with variables in guile. That would be perfect. Just text, like normal text, or markdown, with variables inside in guile. Would be nice.
<thetan>let me see artanis
<amz3>I was like you before doing templating with sxml
<rain1>thetan, https://www.gnu.org/software/artanis/manual/html_node/Layouts-and-Rendering-in-GNU-Artanis.html#Layouts-and-Rendering-in-GNU-Artanis
<rain1>but you may not be able to use it easily if you are not using artanis
<rain1>sorr that link sucks
<rain1> https://www.gnu.org/software/artanis/manual/html_node/Templating.html#Templating
<thetan>compiling artanis to see if it will be of use
<thetan>amz3: do you think that by using sxml I could use simple text with embedded guile variables?
<amz3>thetan: yes/no... you can generate the sxml then convert that to plain text
<thetan>ok I got it that sxml is like json to javascript
<amz3>list is the primitive
<amz3>sxml is to scheme list what atom is to xml, it's particular way to use list to represent xml/html document
<amz3>there is no well known json format to make the comparison between scheme list and json
<amz3>you write directly sxml using quote and can unquote to generate more complex datastructures
<amz3>I will redirect you to my project, since it use sxml like that it's better (for me) than writing english
<thetan>yes, I see amz3. I need only simple thing to write variables or pieces of guile in the text
<amz3>thetan: then use format
<amz3>here is the template section of my small blog engine: https://git.framasoft.org/a-guile-mind/nanoblog/blob/master/nanoblog.scm#L75
<amz3>aka. nanoblgo
<amz3>aka. nanoblog
<amz3>look for procedures that stats with "template:" to learn how the main template is populated
<thetan>aha let me see
<thetan>amz3 do you have link to nanoblog? Hard to find
<amz3>link? you the hosted version?
<amz3>it's not online yet
<thetan>where do I find it?
<thetan>I found this similar thing what I need: http://unknownlamer.org/code/guile-web-manual.html#SEC7
<thetan>it uses templating, maybe guile can be embedded in the text, I don't know
<amz3>if you simply want to generate, say an email, you'd better use format procedure
<thetan>I have 20,000 pages in markdown, using variables like {$something} -- I would like to replace variables with guile inside.
<amz3>have a look at CommonMark or https://git.framasoft.org/a-guile-mind/little-markdown-parser
<amz3>I understand know what you have in mind
<amz3>you might be able to customize one of the markdown parser to do what you want
<stis>amz3: what do you think about copying guile-logs parser framework over to kanren?
<stis>There really is no obstacle to do that. Just some work!!
<amz3>stis: this sound like fun, I will have look
<amz3>stis: I implemented a version of the markdown parser, that returned multiple parse results, but could not figure how to choose from the result set or cut some result from the result set
<amz3>I wanted to avoid the use of 'if' like parser
<stis>'ifä ?
<stis>if ?
<stis>do you use guile-log? do you have an example? source code?
<amz3>I mean to write 'not' parser. I'm not using guile-log syntax.
<amz3>not i trashed the code
<amz3>*no
<amz3>it was not using guile-log
<thetan>amz3: yes I see, that guile-parser-combinators https://git.dthompson.us/guile-parser-combinators.git/blob/8e02ee35745edc88e29159c18e0e28a67778e9e2:/parser-combinators.scm could be solution to implement variables together with markdown.
<amz3>thetan: that's what little markdown use
<amz3>it's only a subset of markdown and not commonmark
<amz3>for instance it doesn't support bullet list
<amz3>ACTION afk
<thetan>oh seems too much for me as being at day one with guile
<thetan>but OK, I don't need markdown, just to replace few variables.
<cojy>is prompt removal essentially optimization of one-shot continuations?
<thetan>first variables, then I can do markdown
<thetan>Probably I must read ice-9 match
<wingo>cojy: good question! i don't know but it sounds like it, yeah.
<cojy>like this http://lambda-the-ultimate.org/node/5055#comment-82456
<wingo>or turning prompt/abort into try/catch
<wingo>and try/catch into goto
<civodul>or 'let/ec'
<cojy>basically im doing Eff as a macro https://paste.debian.net/412533/
<cojy>itd be nice to know of the state monad ones arent actually copying the stack since they are only called once in place
<cojy>also are there multi-prompt continuations in guile?
<wingo>what is a multi-prompt continuation?
<wingo>ACTION learning new things :)
<cojy>(shift-at prompt k ....) instead of (shift k ...) which does it to a default prompt
<wingo>yes
<wingo>see (ice-9 control) if you prefer shift/shift-at etc over call-with-prompt/abort-to-prompt
<wingo>actually
<wingo>it seems that the shift-at wrapper isn't implemented
<wingo>but it can be, it's a straightforward thign
<wingo>see module/ice-9/control.scm:65
<wingo>patches welcome :)
<cojy>ah ty
<thetan>someone knows what is GNU alternative to Yaml? To read config file.
<rain1>maybe you could use a scheme file
<thetan>oh... exactly
<thetan>just guile
<thetan>how simple
<rain1>:D
<thetan>rain1: I am in the new old world.