dbmikus has joined #racket
dbmikus has quit [Ping timeout: 252 seconds]
dbmikus has joined #racket
iyzsong has joined #racket
libertyprime has quit [Ping timeout: 244 seconds]
dbmikus has quit [Ping timeout: 252 seconds]
libertyprime has joined #racket
libertyprime has quit [Ping timeout: 272 seconds]
iyzsong has quit [Ping timeout: 252 seconds]
dbmikus has joined #racket
libertyprime has joined #racket
libertyprime has quit [Ping timeout: 268 seconds]
selimcan has joined #racket
<lavaflow> is there any sort of "more permissive" apply? such that (permissive-apply + 1 '(1 1) 1 '(1)) would return 5?
keep_learning has quit [Remote host closed the connection]
pera has quit [Ping timeout: 244 seconds]
ubLIX has quit [Quit: ubLIX]
pierpal has joined #racket
dbmikus has quit [Quit: WeeChat 2.3]
iyzsong has joined #racket
g00s has quit [Ping timeout: 268 seconds]
selimcan has quit [Quit: Leaving]
_whitelogger has joined #racket
pierpal has quit [Quit: Poof]
pierpal has joined #racket
g00s has joined #racket
g00s has quit [Quit: Textual IRC Client: www.textualapp.com]
jao has quit [Ping timeout: 244 seconds]
dddddd has quit [Remote host closed the connection]
ZombieChicken has quit [Remote host closed the connection]
ZombieChicken has joined #racket
g00s has joined #racket
buyfn has joined #racket
buyfn has quit [Quit: buyfn]
aquiandres has joined #racket
iyzsong has quit [Quit: ZNC 1.7.1 - https://znc.in]
iyzsong has joined #racket
g00s has quit [Quit: Textual IRC Client: www.textualapp.com]
Fernando-Basso has joined #racket
aquiandres has quit [Read error: Connection reset by peer]
aquiandres has joined #racket
aquiandres has quit [Quit: Leaving]
aquiandres has joined #racket
aquiandres has quit [Read error: Connection reset by peer]
aquiandres has joined #racket
aquiandres has quit [Read error: Connection reset by peer]
_whitelogger has joined #racket
aquiandres has joined #racket
aquiandres has quit [Quit: Leaving]
YuGiOhJCJ has joined #racket
ZombieChicken has quit [Ping timeout: 256 seconds]
ZombieChicken has joined #racket
ZombieChicken has quit [Ping timeout: 256 seconds]
mahmudov has quit [Ping timeout: 240 seconds]
mzan has joined #racket
acarrico has quit [Ping timeout: 240 seconds]
Fernando-Basso has quit [Remote host closed the connection]
odanoburu has joined #racket
dddddd has joined #racket
iyzsong has quit [Ping timeout: 252 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #racket
acarrico has joined #racket
pie_ has joined #racket
Sgeo has quit [Read error: Connection reset by peer]
Sgeo has joined #racket
jao has joined #racket
Sgeo_ has joined #racket
Sgeo has quit [Ping timeout: 252 seconds]
acarrico has quit [Ping timeout: 268 seconds]
dan_f has joined #racket
dustyweb has joined #racket
<dustyweb> gosh
<dustyweb> DOS really breaks my brain
Falacer has joined #racket
dustyweb has quit [Read error: Connection reset by peer]
dddddd has quit [Remote host closed the connection]
mzan has left #racket [#racket]
dan_f has quit [Quit: dan_f]
jsomedon has joined #racket
dbmikus has joined #racket
dustyweb has joined #racket
Fernando-Basso has joined #racket
vraid has joined #racket
jsomedon has quit [Quit: jsomedon]
Falacer has quit [Quit: leaving]
odanoburu has quit [Quit: Connection closed for inactivity]
dbmikus has quit [Quit: WeeChat 1.9.1]
rnmhdn has joined #racket
<rnmhdn> don't we have anything like list-head in racket?
<lexi-lambda> rnmhdn: What would that function do?
<rnmhdn> what list-tail does in the other direction
<lexi-lambda> Oh, I think you want drop-right.
Sgeo_ has quit [Read error: Connection reset by peer]
<rnmhdn> yes
<rnmhdn> thank you.
Sgeo_ has joined #racket
<rnmhdn> I don't like their naming:-" neither do I like their guide
<rnmhdn> I think they should include drop-right just after list-tail in their guide
<rnmhdn> idk
<rnmhdn> nvm
<rnmhdn> thanks
<rnmhdn> I have to write a program that does this:
<rnmhdn> It takes: '(* + 2 1 / 3 * 2 - 6 1)
<lexi-lambda> I think list-tail is sort of weird… it’s the same thing as `take`. I think it’s documented separately because it comes from racket/base, but the others don’t.
pie_ has quit [Ping timeout: 252 seconds]
<rnmhdn> oh
<rnmhdn> It takes that and calculates 9/10 as the result
<rnmhdn> do you understand how?
<rnmhdn> now I'm thinking that I would start from the end of the list and find the first operator and eval that operator with the next two numbers after it and I repeat this until I get to a single number
<rnmhdn> Is this the racket way of making such program?
<rnmhdn> I'm not so experienced with functional programming
<rain1> I would recommend starting at the front of the list
<rnmhdn> I mean is this also how you people would approach such a problem?
<rnmhdn> rain1: and then what?
<rain1> it's a little bit tricky if you're a beginner
<lexi-lambda> I don’t think you should ever use eval unless you are implementing DrRacket.
<rnmhdn> lexi-lambda: then what should I do?
<lexi-lambda> I would make a hash table that maps operator symbols to functions.
<rain1> but basically you would like to have a function that reads a 'thing' from the list, and returns the rest of the list
<lexi-lambda> Or just a function that uses `case` or `match` to map a symbol to its function.
<rain1> so (f '(1 2 3)) would return 1 and (2 3). and (f '(+ 2 1 x y z)) would return 3 and (x y z)
<rain1> do you see what i mean?
<rain1> [and i agree that you wont need to use EVAL here]
<rnmhdn> and what would (f '(+ - 1 2 3)) return?
<rnmhdn> I think I should start from the end of the list
<rain1> that would return 2 and '()
<rnmhdn> but how?
<rnmhdn> my idea is that my program would find that -
<rnmhdn> and then replace - 1 2 with -1
<rain1> So you have got a different approach to the problem and I think that's good and you could work on that way!
<rnmhdn> so It gets to '(+ -1 3) which is 2
<rain1> I was just talking about the way I thought to do it
<rnmhdn> rain1: I don't understand how your approach could be implemented
<rnmhdn> how does f calculate 2 from '(+ - 1 2 3)?
<rain1> 2 is the correct result isn't it?
<rain1> just checking in case i got it wrong
<rnmhdn> from my understanding it should return '(+ - 1) and (2 3)
<rnmhdn> yes 2 is the correct result
<rain1> the idea is that f would see the + and try to read off two 'things' from the list and then add them
<rnmhdn> lexi-lambda: I don't understand why I shouldn't use eval here
<rnmhdn> rain1: yes but how?
<rain1> by calling f twice
<rnmhdn> I don't understand:(
<rain1> ill show the steps
<rain1> (f '(+ - 1 2 3)) takes the + off and knows + needs 2 items
<rain1> so it calls (f '(- 1 2 3)) next, getting -1 and '(3)
<rain1> then for the next item it calls (f '(3)) getting 3 and '()
<rain1> then it returns (+ -1 3) giving 2 and '()
<rnmhdn> I get it
<rnmhdn> thanks
<rnmhdn> rain1: how can I not use eval?
<rain1> so when you take the car of the list you either get a number and return it & the cdr of the list
<rain1> or you get a symbol (which'll be one of + - * /) then you need to take 2 items off the list recursively
<rain1> so you need a helper function that turns those symbols into the functions
<rain1> that would look like this (define (get-operator sym) (cond ((eq? sym '+) +) ((eq? sym '-) -) ...
<rain1> so in scheme you can do ((get-operator '+) 5 3) and it gives 8
<rnmhdn> uhum
<rnmhdn> thanks
<rain1> that's the trick to avoid eval. was it confusing?
<rnmhdn> I think I got it:D I'm gonna try to implement it now
<rnmhdn> is there something like switch case in racket?
<rnmhdn> I can't find it in the docs
<rain1> yeah, CASE
<rnmhdn> how can I find it in the docs?
<rnmhdn> how can I find the documentation for case in racket?
<rain1> just put it in
<rnmhdn> oh ok thanks
pie_ has joined #racket
slemonide has joined #racket
slemonide has quit [Client Quit]
<rnmhdn> how should I name f in racket?
<rnmhdn> like get_arg?
<rnmhdn> get-arg
<rain1> I couldn't think of a good name for it
pie_ has quit [Read error: Connection reset by peer]
<rain1> but naming it well is really important
pie_ has joined #racket
<rnmhdn> I mean like what do racket people use
<rnmhdn> camelcase
<rnmhdn> _
<rnmhdn> what?
<rain1> get-arg
<rnmhdn> thanks
<rnmhdn> thank you so much rain1
<rnmhdn> I learnt some nice things about how I should think functional
<rnmhdn> :D
<rnmhdn> It's cool
pie_ has quit [Remote host closed the connection]
danielboston26 has joined #racket
<danielboston26> how do i add racket to my path in debian?
hs0ucy has quit [Read error: Connection reset by peer]
rnmhdn has quit [Ping timeout: 252 seconds]
pierpal has quit [Ping timeout: 268 seconds]
<danielboston26> ive added /home/bin/racket to path but when i type racket i gget command not found
<rain1> try drracket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
<rain1> or add /home/bin/ to PATH
dbmikus has joined #racket
<danielboston26> i did but i fixed it
<danielboston26> i just uinstalled it and reinstalled and it worked
<danielboston26> not sure why didn't work the first time
<danielboston26> wow this room is dead
<danielboston26> !hi
<danielboston26> #slap
danielboston26 has quit [Quit: Leaving]
pie_ has joined #racket
g00s has joined #racket
rain2 has quit [Quit: WeeChat 2.2]
<rain1> https://github.com/true-grue/raddsl it would be awesme to have a tool like this for racket
<lexi-lambda> rain1: Isn’t rewriting part served by syntax/parse?
<rain1> cool idea!
ZombieChicken has joined #racket
<lexi-lambda> rain1: I guess I just don’t understand what part of that project you think doesn’t already exist in Racket.
dbmikus has quit [Ping timeout: 250 seconds]
orivej_ has quit [Ping timeout: 246 seconds]
g00s has quit [Quit: Textual IRC Client: www.textualapp.com]
pierpal has joined #racket
pierpal has quit [Ping timeout: 244 seconds]
dbmikus has joined #racket
Fernando-Basso has quit [Remote host closed the connection]
vraid has quit [Ping timeout: 252 seconds]