<roelj>Any convenient way to replace all occurrences of a character in a string with another character? <lloda>(string-map (lambda (c) (if (char=? c a) b c)) s) <OrangeShark>amz3: for guile-git, I am thinking we should just call libgit2-init! in the git module. <happy_gnu>I am trying to create a random number in an interval, but I have no idea how to do it <stis>(define (my-random a b) (let ((d (- b a))) (+ a (* (random-real) d)))) <lloda>(random d) is in (guile). Only problem is that (random 0) is an error :-/ <happy_gnu>how can I write a function that set! and calls another function <happy_gnu>I would like smaller to set big to 8 and after that to execute guess-number <stis>happy_gnu: (define big 1) (define (smaller) (set! big 8) (guess-number) <stis>you need to define big first <stis>you can also use lamabda <stis>(define smaller (lambda () ....)) <stis>you call smaller as (smaller) <happy_gnu>ohh thanks stis I was lacking the parentheses on (smaller) :) <stis>there is macrology that allows you to call a function by just issuing the symbol btw, but it's considered bad style <stis>try (define syntax s (syntax-rules () (_ (smaller)))) <stis>(define-syntax s (lambda (x) (syntax-case x () (_ #'(smaller))))) <avoine>stis: about your parser, in your calculator for example, if I want to transform the result of the parser into scheme I can I do it? <stis>as in an scheme evaluater or as in scheme code? <stis>maybe I should make a compiler and an evaluater and make a calc language for you all to try ***sudoman_ is now known as sudoman
<avoine>stis: so I fold on the result and transform it with a pattern match for example? <stis>let me check in my evaluator, hang on a sec <stis>check out the repository, calc has an evaluator, (e "1 + 1") -> 2 <stis>avoine: yes you can use eval <avoine>oh that e is what I'm looking for! <stis>update, I added a spec.scm file in language/calc that enables the calculator as a command line feature, obs line based <stis>it's a good simple example to learn from <stis>Yeah I tested and made an example in calc.scm of the expression parser tool. enjoy (see README) <happy_gnu>stis: is that a program you wrote? do you have a repository to read the code :) ? <happy_gnu>i've read that to learn programming is important to read a lot of code :) <happy_gnu>I've been reading a few gimp plugins, but they use a lot let*, and I think simple scheme or SICP say that let* is bad practice :/ <amz3`>happy_gnu: why do you think let* is bad pratice? <happy_gnu>amz3`: I read it or watch in eitheir simple scheme or SICP <amz3`>maybe it's because let* does some magic that is not required most of the time <happy_gnu>I don't remember which one though, but I am just starting so maybe it was to start. <happy_gnu>yeah amz3`, something like that, I think it was on the videolectures of sicp, that they said it is mostly not used by schemers <rekado>when a simple “let” is enough, there’s no need for “let*” <happy_gnu>I am not sure, I am reading the 2 books and watching the video lectures of berkeley and mit <amz3`>happy_gnu: I doing a screencast on guile hacking on youtube <rekado>but when you want to have a binding that refers to a previous binding there really isn’t any other elegant way <happy_gnu>there is not the same quantity of learning materials for python or javascript than there is for scheme <amz3`>sometimes I nest let to document better the code <happy_gnu>but so far I am loving way more scheme than python or javascript is so much simpler, so understendable <amz3`>happy_gnu: you mean that there is no one liner solution for left padding a string on stackoverflow in scheme? <amz3`>happy_gnu: what do you want to hack on? <amz3`>happy_gnu: any particular project you'd like to realize? <amz3`>happy_gnu: any particular interest <happy_gnu>amz3`: for now I am just starting, so I am trying to learn :) maybe a videogame <amz3`>happy_gnu: you are right, usually stis does advanced stuff I still don't fully grasp <happy_gnu>I saw guile-2d which now has a different game but, I get a little confused <amz3`>the first seven videos are about a full stack scheme web framework <happy_gnu>i am also reading "the land of lisp" it uses clisp but I am trying to translate it to scheme <amz3`>happy_gnu: I don't educate tho <rekado>happy_gnu: there’s also “realm of racket” <amz3`>I am mean, I don't try to explain everything, but if you have question, don't hesitate to ask here or in the comment section <amz3`>the second part is about wiredtiger, a database library similar to sqlite <happy_gnu>amz3`: yes, thanks :) this is too good, I need to learn more and more <amz3`>happy_gnu: if you have a particular idea, outside making a game for a project I could make a video about it explaining how to do it <happy_gnu>you have the same wallpaper than I, by the way <random-nick>happy_gnu: referring to common lisp as "clisp" is ambiguous because there's an implementation of common lisp called GNU CLISP <amz3`>happy_gnu: best way to learn is to have pet projects i think <amz3`>happy_gnu: or try to contribute <amz3`>happy_gnu: I would be very HAPPY if there was an equivalent of docopt in guile <happy_gnu>amz3`: when I see code I tend to feel stupid :/ <amz3`>happy_gnu: you have a good habit if you read code <amz3`>happy_gnu: i don't read much code actually <OrangeShark>random-nick: if I recall, land of lisp does in fact use GNU CLISP <cmaloney>Land of Lisp uses Common Lisp. Don't recall if it's specifically GNU CLISP <amz3`>Land of Lisp is the tutorial with aliens and stuff? <random-nick>OrangeShark: then I must've confused it with some other book <happy_gnu>SICP is really god but there are many math excercises I can't do :/ <cmaloney>Land of Lisp shares the same authors as Realm of Racket <amz3`>happy_gnu: which programming language do you know? <amz3`>happy_gnu: I got another idea, I wrote a very small editor using Guile, you can read the code, try the editor and do a feature request that I can implement in a video :) <amz3`>happy_gnu: I am champion toy program developper :) <rekado>happy_gnu: I haven’t finished SICP; I really enjoyed the video lectures, though. <amz3`>I did not read SICP too boring for me <happy_gnu>amz3`: I know a little python and a little javascript <amz3`>happy_gnu: you don't have a CS background? <amz3`>if you don't havea computer science background reading SICP or racket book will be helpful <amz3`>though I started writing webapps before doing all the CS stuff <amz3`>happy_gnu: maybe you can create a game for the terminal? <amz3`>happy_gnu: what game are you interested in? <amz3`>I mean it's not too difficult <happy_gnu>ohh I thougt it was because of the many possibilities <amz3`>you can create a program for a simpler board game <cmaloney>Or even something that referees two human players <amz3`>the rules of Go are much simpler than chess <cmaloney>Go has capture rules that can get pretty complex <amz3`>I mean that there is less combination of movement <cmaloney>Right, go doesn't have as many special pieces <cmaloney>could make something simple like "capture go" <amz3`>maybe power of 4 is the easiest <cmaloney>happy_gnu: It's a fun game, and much like scheme it starts simple and has a huge rabbit-hole attached to it. :) <amz3`>until recently no computer could beat a human player <amz3`>I mean computer could not beat the champion go players <cmaloney>but even GNU Go is pretty weak and formulaic compared with expert Go players <amz3`>happy_gnu: I think mastermind is easy to program <amz3`>happy_gnu: no no, it's a standalone editor <amz3`>it has emacs bindings but that's all, it's not related to emacs, it's more minimal than nano <amz3`>termbox library is very easy to work with <amz3`>yeah, that's because I use emacs, that's emacs config file <amz3`>I am trying to gather some energy, to record a new video <happy_gnu>amz3`: are the youtube videos about toy editor? <amz3`>happy_gnu: no, but I could make a video about the toy editor <amz3`>I am not sure what to explain tho <happy_gnu>amz3`: which one is the better github or framatig.org ? <amz3`>honestly I don't know I use both <amz3`>I think none of them is good :) <happy_gnu>amz3`: sorry, i meant which one is more up to date :) ? <amz3`>happy_gnu: I don't understand <amz3`>framagit and github are different softwares <amz3`>I will record another video about sotogu <cmaloney>How does one incorporate the termbox module? I'm not seeing how to get started with this <amz3`>cmaloney: you need to install termbox library from github <amz3`>cmaloney: the main is in azul.scm <cmaloney>quick question: is this library for guile 2.2? <amz3`>it requires guile-bytestructures from guix <amz3`>cmaloney: install guix it's easy to install ;) <cmaloney>unable to locate the ubuntu package for guix. ;:-P <amz3`>ArneBab_: do you remember what is the correct shebang to use to execute a given procedure inside a module