IRC channel logs


back to list of logs

<happy_gnu>I am learning guile :) with SICP
<happy_gnu>I know a little of drracket because I started with Htdp
<happy_gnu>I am trying to do this in guile
<happy_gnu>But I can't make it work :/ it works in drracket
<happy_gnu>What am I doing wrong?
<daviid>happy_gnu: are you learning alone or having class somewhere?
<happy_gnu>daviid: I am learning alone
<happy_gnu>I am doing SICP
<daviid>happy_gnu: reading any specific book?
<daviid>ah ok
<happy_gnu>there is a problem to do PASCAL pyramid
<happy_gnu>so I try doing factorial of the number up onto the number and then reverse the factorial
<daviid>so, there are more then one way to go to Rome, but your definition is a bit 'strange'. nonetheless, you carefuly read guile's error message, what does it say?
<happy_gnu>i did (factorial 1 5)
<happy_gnu>it says ERROR: ERROR: Wrong type to apply: 5
<happy_gnu>but as it does work in drracket
<happy_gnu>I thought it was related to the empty at the end
<happy_gnu>and the cons
<daviid>forget ddracket for a moment
<happy_gnu>I would like to create a list with all the numbers, up to any given number
<daviid>you tried the function, but its compiltion or evaluation in the repl already mentioned an error
<daviid>that is the error i'd like you to read (and repeat here if you don't mind)
<happy_gnu>so if I pass 3, it should return 123
<happy_gnu>the only error it shows when I evaluate is this ERROR: ERROR: Wrong type to apply: 5
<happy_gnu>it means that the second number i pass in this case a 5 is wrong
<daviid>happy_gnu: ok, let me try something else with you :) could you rewrite that factorial function so it only receives n (one argument being the number you want to compute the factorial of...)
<happy_gnu>ok daviid
<daviid>good! after you do that and it works, then we will try a tail recursive function, but for now, it is not important
<happy_gnu>hey it works now daviid :) let me send you teh code
<daviid>ok, but you still pass two args, and your base test (= counter x) does not correspond to the math defnition, which since your are learning is a symptom of a bad design, if you allow me. try to rewrite so it receives only n
<daviid>and so the base test case correspnd to the math def of factorial
<happy_gnu>ok daviid
<happy_gnu>daviid: I fixed it, it now takes just one argument, I also would like to apologize, I used factorial, but the term was wrong, is in fact a Pascal triangle
<daviid>happy_gnu: fine
<happy_gnu>that is what I've so far
<happy_gnu>daviid: thanks :)
<daviid>happy_gnu: this is not correct is it? I won't have time to teach you the correct solution though, I'm too busy right now
<happy_gnu>daviid: no is not is just the first part, I wanted to print the numbers, I thought that having this first, and then trying to do it all
<happy_gnu>I understand daviid :) I appreciate your help and time
<daviid>happy_gnu: keep posting and asking here, other guilers will help, if not today tomorroa ...
<happy_gnu>ok :)
<happy_gnu>thanks daviid :)
<daviid>happy_gnu: welcome for info:'s_triangle
<daviid>you list of numbers, if you even just wanted to just return the list of numbers that a pascal triangle would contain for 5 (5 being the number of rows) is incorrect as well
<happy_gnu>ok daviid :)
<happy_gnu>I will fix it
<happy_gnu>ohh daviid I understand, you are right, I was looking at it wrong, I thought that each road was like, 1, 121, 12321, etc.. but no it is different
<happy_gnu>thank you so much my friend, I won't bother you anymore daviid :)
***ertesx is now known as ertes
<amz3>héllo #guile
<amz3>nalaginrut: what feature of git do you need for your blog engine?
<OrangeShark>hello everyone
***sajith is now known as Guest20316
<shinra_>hello world
<shinra_>I would like to thank the guile community for the smartness of their hacks, which does not stop to give me a better undestanding of what is programming
<shinra_>so well, hum. thank you.
<spk121_>shinra_: well, I'm sure you weren't talking about me, haha, but, you are welcome.
<shinra_>I was talking about the group, not specific individuals
<amz3>spk121_: !
<spk121_>amz3: !!
<amz3>spk121_: you are hurting yourself