IRC channel logs

2016-03-23.log

back to list of logs

<Jookia>jmarciano: Fantastic!
<jmarciano>you joke with me
<jmarciano>it is usable to me very much, but not to others
<jmarciano>but Perl's unicode mess... is too much in comparison to Guile
<jmarciano>and it looks dirty somehow
<jmarciano`>any guile import from csv module?
<lloda>you mean something like this? https://gist.github.com/wedesoft/10361176
<lloda>I don't think there's anything standard
<jmarciano`>lloda: let me see
<jmarciano`>I am going to do it simpler than that gist. Like splitting the string simply.
<wingo>splitting the string doesn't work for quoted delimiters
<wingo>but, as you like ;)
<ArneBab_>did I already write here that I created some pull requests for guildhall? https://github.com/ijp/guildhall/pulls
<jmarciano`>looks like package manager
<jmarciano`>but GuixSD is based on Guile, and I tend to use through Guix package manager...
<jmarciano`>but is good to know the list http://shift-reset.com/doro/
<ArneBab_>yepp
<ArneBab_>I hope that I can get it to a state where it can be shipped with Guile by default
<ArneBab_>as a convenient way to get pure Scheme modules
<jmarciano`>I understand yes. I am not sure what is better. Everyone wants to install it in different places.
<jmarciano`>GNU distribution, GuixSD is offering separated profiles, so I rather tend to use it through Guix package manager.
<dsmith-work>Morning Greetings, Guilers
<jmarciano`>what would be easiest way to open up graphical window in Guile? Similar to gxmessage or zenity, that I may ask user for 3-4 lines and finished.
<cojy>is there any way to limit stack growth so a bad recursive function doesn't just keep consuming more memory until my whole system locks up?
<davexunit>cojy: yes, but I can't remember the name of the form right now
<dsmith-work>jmarciano`: You could fork off a zenity or whatever...
<jmarciano`>zenity, but it is not guile based
<jmarciano`>some procedures gives errors, how do I avoid that, with a check?
<mark_weaver>jmarciano`: 'catch'
<mark_weaver>there's also 'false-if-exception', but that's probably best avoided, because it's better to catch only selectively what you expect
<mario-goulart>jmarciano`: some days ago I made a quick scheme wrapper for zenity. It's for chicken, but maybe it can be easily ported to guile: https://github.com/mario-goulart/henity
<jmarciano`>let me try catch, and see henity....
<jmarciano`>what is thunk... need to understand this
<jmarciano`>no definition in dict.org
<amz3>jmarciano`: thunk is a lambda without args
<amz3>lambda/procedure
<amz3>say (lambda () (do something useful)) is a thunk
<jmarciano`>aha
<jmarciano`>I just want to use (stat "file") and if there is no file, I get error.
<amz3>(lambda () (/ 1 x)) is thunk that can fail
<jmarciano`>aha
<amz3>IIRC there is a procedure to check for the existance of a file
<jmarciano`>iirc is what?
<amz3>If I Recall Correctly
<amz3>let me check
<jmarciano`>aha
<jmarciano`>I did not quite learn all terms from FOLDOC
<amz3>(define (path-exists? path)
<amz3> "Return #true if path is a file or directory.
<amz3> #false if it doesn't exists"
<amz3> (access? path F_OK))
<amz3>FOLDOC?
<amz3>got it
<jmarciano`>aha that is working, good
<amz3>jmarciano`: so you can use access? procedure to check for the existence of a file
<amz3>I don't use much exception in Guile, however I don't have much Guile code
<janneke>i think that in gnu we use path for a list of directories
<amz3>janneke: what do you mean?
<amz3>'path' as a word?
<janneke>/usr/bin: file name that happens to be a directory (also a file)
<jmarciano`>amz3: when you put description there, it remains for apropos?
<janneke>"/usr/bin/:/bin:/sbin": a path
<amz3>jmarciano`: yes
<amz3>it's a docstring
<jmarciano`>yes I see, nice.
<jmarciano`>only I don't need your definition, better just access?
<jmarciano`>mario-goulart: when we say binding for zenity, does it mean, it binds to C functions? And uses maybe some library?
<amz3>janneke: this is surprising to me, python os.path module deals both with files and directories but not with PATH
<mario-goulart>jmarciano`: no, it shells out the zenity program. Bindings for the zenity tool.
<jmarciano`>so it just calls like (system "zenity -- stuff")?
<mario-goulart>Not really "shells out". It execs zenity, actually.
<jmarciano`>aha
<mario-goulart>Roughly that, except it doesn't go through the shell.
<jmarciano`>aha exec yes
<jmarciano`>if I use within lambda, (let () something), will something remain after for lambda?
<jmarciano`>and how to make empty string
<jmarciano`>I am inside of (define some (lambda. -- I use (if and within it, use let variable) but that variable is not showing outside.
<rain1>would you like to show the code?
<jmarciano`>yes, from yesterday, I must improve it to include SSL...
<rain1>then I can make suggestions
<jmarciano`> http://paste.lisp.org/display/311262
<jmarciano`>I learn from cluets, not from complete solutions, that hurts
<rain1>this looks like it should work
<rain1>is there any problem? with that code
<rain1>I can suggest a style improvement
<jmarciano`>the set! is correct? so far? How would you use inside variable?
<jmarciano`>now I am getting it...
<jmarciano`>I got it working this way.
<rain1> http://paste.lisp.org/display/311262#1
<jmarciano`>but I like to learn style suggestion
<rain1>here's how with LET instead of SET!
<jmarciano`>that is what I wanted basically.
<jmarciano`>because in that manner i don't need to define something outside of lambda
<jmarciano`>thanks
<rain1>yeah :)
<jmarciano`>now just nginx ssl section to define...
<jmarciano`>because I have many websites, it is easier to read directory and generate config.
<jmarciano`>for ssl, if it detects ssl file, generates ssl config automatically
<jmarciano`>because letsencrypt has known directories...
<jmarciano`>let me see if working
<jmarciano`>ohh working...
<jmarciano`> http://paste.lisp.org/display/311263
<jmarciano`>letsencrypt saves me some serious money...
<rain1>you don't pass ssl-section into nginx-http-conf
<rain1>oh but you call it inside the if
<jmarciano`>well I told you it works, SSL is working already...
<rain1>I see!
<rain1>you don't need toh let anymore
<jmarciano`>how?
<rain1>andy ou could change the IF to a WHERE
<rain1>because ssl-section is not used
<jmarciano`>sharp eye
<rain1> http://paste.lisp.org/display/311263#2
<rain1>like that
<rain1>just an idea
<jmarciano`>aha
<jmarciano`>I have it now like this: http://paste.lisp.org/display/311264
<jmarciano`>if or when... never mind, when it works
<jmarciano`>oh not working for multiple websites...
<jmarciano`>aha did not synchronize file "ssl"
<jmarciano`>not so easy with letsencrypt, if multiple subdomains, they put it under one... but ok so far
<jmarciano`>rain1: do I use "root" in nginx-http-conf(s) wrong?
<rain1>not wrong no
<rain1>its fine but you could remove it
<rain1>(lambda(website root) -> (lambda(website)
<rain1>asdh
<jmarciano`>because one root is defined before that, so I dont know which one is going to be used
<rain1>(nginx-https-conf n root) -> (nginx-https-conf n)
<rain1>either way is fine
<rain1>the uses of root refer to the innermost lambda
<jmarciano`>actually the root should be cwd
<jmarciano`>but ok
<jmarciano`>aha
<jmarciano`>so in lambda, if I use variable, it is not used the one from outside?
<jmarciano`>never mind, it is good to learn
<rain1>thats right
<rain1>it's called scope
<rain1>most important concept in lisp
<jmarciano`>yes? Which one
<rain1>scope :)
<jmarciano`>aha scope, yes, inner, outside
<jmarciano`>of course I must know where which variables apply
<davexunit>lexical scope to be precise
<jmarciano`>like to which scope some word belongs...
<bavier>haha, just reading through guile source, and see that it includes support for the Cray1
<linas>dumb question: I get this error: `warning: possibly unbound variable` whenever I compile code that references some guile function defined in a C library.
<linas>how do I make it stop?
<civodul`>bavier: that thing about pointers on Cray always seemed weird and intriguing to me :-)
<fhmgufs>Hello, another question, again. :)
<fhmgufs>What's the easiest way to get the index of the first element in a vector being equal to a specified value?
<fhmgufs>I mean the opposite of (vector-ref vec i) => elem i.e. for example (vector-index vec elem) => i (I know that there's already a procedure vector-index)
<fhmgufs>Is there a function or another way to do that?
<fhmgufs>Iterating over the vector with (for each) and setting an auxiliary variable seems too inelegant to me.
<davexunit>fhmgufs: seems like you already found the answer
<davexunit>vector-index
<davexunit>(vector-index (lambda (x) (equal? x thing)) #(...))
***amz3 is now known as luc2
***luc2 is now known as amz3
<fhmgufs>davexunit: Ah, yes, thanks. I should have tried this. :)
<fhmgufs>The major advantage of Scheme is that everything is logical.
<davexunit>because things compose :)
<Jookia>Compose, as in f . g?
<civodul>as in (compose f g)
<civodul>:-)
<Jookia>Part of me is bothered by lack of infix operators, but the other part of me keeps reminding myself how often I'd wrap things since I didn't remember precedence, or more importantly, didn't think the people reading my code would
<davexunit>infiz doesn't scale :P
<davexunit>infix*