<paroneayea>wingo: I am hitting an opaque error in compiling my attempt at merging <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>configure: --disable-silent-rules verbose build output (undo: "make V=0") <janneke>so that would be: make V=1 or --disable-silent-rules <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! <paroneayea>john wiegley said "*that's* guile emacs??" when he saw it booted up, surprised <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??" <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>(if (null? (cdr (command-line))) (quit)) <thetan>I have got it working like this. Thank you much. <thetan>Where in the Guile docs I find definitions of cdr and cadr ? <janneke>then, go to the Guile manual: m Guile Reference 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>yes, the `?' suffix is conventionally used as a test <thetan>aha kg is string because of cadr? <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? <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... <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? <janneke>/me is looking at the first index reference: 7.2.6 Runtime Environment <thetan>aha I get it. Where do I find reference to display just 2 decimals instead of many? <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. <janneke>ArneBab: doesn't perl treat strings like numbers and vice-versa? <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: <janneke>thetan: something like: (/ (truncate (* 100 3.1415)) 100) <thetan>truncate is good, only it rounds number rather, than showing 2 decimals for example <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) <thetan>How do I get pwd or current directory in guile? <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>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? <amz3>small question what are you using as feed reader? <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: that said, removing the first element of a list is simply cdr <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 <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 <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>(eq? (cadr (program-arguments)) "link") <thetan>hard to understand why is it false <jlicht>thetan: eq? is not the procedure you're looking for ;-) <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") <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>ERROR: No variable named equal in #<directory (guile-user) 1a99c60> <thetan>how do I test for number of elements in the list? <thetan>already replaced 2 local Perl scripts with guile. <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 <paroneayea>janneke: mostly amazement that it could do as much as it could, and looked like normal emacs <paroneayea>I might have fixed the error preventing the successful merge <paroneayea>I got bipt's elisp branch running on top of current git master! <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... <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 <thetan> janneke: thank you, I found mailutils <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 <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: and also there was a guile-markdown thing posted to the guile-user mailing list recentlyish for the potluck I thinnnnnk? <rain1>because it has a thing for templating <janneke>ACTION wrote something for templating <amz3>rain1: I answer nonetheless, I don't use artanis templating <janneke>hmm, would be nice to use/create a common implementation <paroneayea>if it's for html'ish things, sxml with quasiquote is quite nice :) <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. <amz3>I was like you before doing templating with sxml <rain1>but you may not be able to use it easily if you are not using artanis <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>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>look for procedures that stats with "template:" to learn how the main template is populated <thetan>amz3 do you have link to nanoblog? Hard to find <amz3>link? you the hosted version? <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>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>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>it was not using guile-log <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 <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. <wingo>or turning prompt/abort into try/catch <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>see (ice-9 control) if you prefer shift/shift-at etc over call-with-prompt/abort-to-prompt <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 <thetan>someone knows what is GNU alternative to Yaml? To read config file. <rain1>maybe you could use a scheme file <thetan>rain1: I am in the new old world.