lexi-lambda changed the topic of #racket to: Racket v7.1 has been released: http://blog.racket-lang.org/2018/10/racket-v7-1.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
dustyweb has joined #racket
iyzsong has joined #racket
YuGiOhJCJ has joined #racket
dddddd has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 250 seconds]
FreeFull has quit []
kotrcka has left #racket [#racket]
raoul has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
<raoul> Hi, I am having trouble with a recursive grammar in megaparsack. I am trying to do some kind of reverse polish notation, so I want to have the arguments before the function token. Following the tutorial did not help, unfortunately.
<raoul> The paste is here: http://pasterack.org/pastes/46383
<raoul> Specifically, it fails on the first line of the '(do ...)' expression in 'funcall/p' with 'expression/p: undefined;
<raoul> cannot reference an identifier before its definition'
<raoul> Evidently because of the recursion, because if I change 'expression/p' to 'number/p' on this line, it works.
<raoul> Is there a workaround to that problem? Thanks!
meepdeew has joined #racket
dustyweb has quit [Ping timeout: 272 seconds]
raoul has quit [Read error: Connection reset by peer]
raoul has joined #racket
raoul has quit [Read error: Connection reset by peer]
libertyprime has quit [Quit: leaving]
rnmhdn has joined #racket
<rnmhdn> is begin in racket like do in haskell?
<jcowan> rnmhdn: Only vaguely. It executes a sequence of expressions for their side effects, and returns the value of the last one.
<rnmhdn> can you compare it with haskell do for me?
<jcowan> You can't assign a value to a local variable, as do allows. It isn't translated into bind chains. Scheme is not naturally moandic; any expression might have a side effect (in effect, you are always in the IO monad).
<jcowan> e.g. (begin (write "abc") (write "def")) simply does one write followed by the other.
<jcowan> Do you know any languages besides Haskell?
<rnmhdn> functional? no
<jcowan> what else?
<rnmhdn> I know python,c,java well
<rnmhdn> I know matlab and js a little also
<jcowan> okay, (begin (this) (that)) is just C { this(); that(); }
<rnmhdn> actually I know more racket than Haskell
<rnmhdn> I mean my question is mostly about Haskell:D
<rnmhdn> I'm learning monads now:D
* jcowan nods
<rnmhdn> :D sorry:P
<jcowan> no problem
<rnmhdn> so can you hint me a little so I understand do in haskell?
<jcowan> The way I think of it (and there are many other ways) is that a monad is a container, and you can do operations on the thing(s) in the container and you wind up with it still in the container.
<rnmhdn> but what I see is something like this:
<rnmhdn> do x <- mx y <- my return (x+y)
<rnmhdn> x <- mx is there part I don't understand.
<rnmhdn> actually I understand what that line does as a whole.
<jcowan> Do you mean "m x"?
<rnmhdn> but it's just like a magic syntax for me. I don't understand it's different components how they work together
<rnmhdn> jcowan: some videos write mx some videos write m x. I guess yes I mean m x
<jcowan> aFor now that's probably good enough.
<rnmhdn> ok then:D thanks:)
_whitelogger has joined #racket
<lexi-lambda> rnmhdn: If you are familiar with Racket macros, then one way to think about `do` notation is as a small macro over combinations of `>>=` and lambda. (Indeed, this desugaring is how it’s defined.)
<lexi-lambda> There isn’t really a meaningful correspondence between `do` and `begin` except for superficial similarities (`do` sugar allows some Haskell code to be written in a pseudo-imperative style).
<rnmhdn> lexi-lambda: oh thank you:D
<lexi-lambda> My recommendation is: if you want to just write some useful Haskell code, you don’t have to understand `do` completely; you can treat it like a black box and learn by example. But eventually you will probably want to understand what it really does, and at that point you should make sure you understand `>>=` and `pure`/`return`.
<lexi-lambda> (And then you can treat `do` as simple sugar over those things.)
<meepdeew> Using (require 2htdp/image), so just early BSL, what might be the simplest way to draw variably-sized slices of a circle? I want to make a function that makes basically a pizza slice, given a radius and degree as input
jao has joined #racket
<meepdeew> I know about, for example, (crop 40 40 40 40 (circle 40 "solid" "red")), and whatnot, but if I want to, say, cut that in half symmetrically?
_whitelogger has joined #racket
jao has quit [Ping timeout: 246 seconds]
_whitelogger has joined #racket
_whitelogger has joined #racket
endformationage has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #racket
pierpal has quit [Ping timeout: 268 seconds]
brendyyn has joined #racket
pierpal has joined #racket
buyfn has joined #racket
pierpal has quit [Ping timeout: 246 seconds]
fmnt has joined #racket
orivej has joined #racket
buyfn has quit [Quit: buyfn]
pierpal has joined #racket
rnmhdn has quit [Ping timeout: 250 seconds]
davidl has quit [Ping timeout: 246 seconds]
badkins has quit [Read error: Connection reset by peer]
badkins has joined #racket
davidl has joined #racket
rnmhdn has joined #racket
jao has joined #racket
buyfn has joined #racket
dmiles has quit [Ping timeout: 245 seconds]
buyfn has quit [Quit: buyfn]
logicmoo has joined #racket
ZombieChicken has quit [Ping timeout: 256 seconds]
jao has quit [Ping timeout: 245 seconds]
fmnt has quit [Quit: Leaving.]
mzan has joined #racket
rnmhdn has quit [Quit: WeeChat 2.3]
dddddd has joined #racket
logicmoo is now known as dmiles
orivej has quit [Ping timeout: 245 seconds]
Lowl3v3l has joined #racket
_whitelogger has joined #racket
fmnt has joined #racket
buyfn has joined #racket
meepdeew has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #racket
orivej has joined #racket
jao has joined #racket
iyzsong has quit [Read error: Connection reset by peer]
iyzsong has joined #racket
mahmudov has joined #racket
jao has quit [Ping timeout: 245 seconds]
dustyweb has joined #racket
iyzsong has quit [Ping timeout: 250 seconds]
mzan has quit [Read error: No route to host]
pierpal has quit [Quit: Poof]
pierpal has joined #racket
obfusk has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
buyfn has quit [Quit: buyfn]
buyfn has joined #racket
mzan has joined #racket
ZombieChicken has joined #racket
tilpner has quit [Quit: WeeChat 2.3]
tilpner has joined #racket
tilpner has quit [Quit: WeeChat 2.3]
tilpner has joined #racket
meepdeew has joined #racket
pierpal has quit [Quit: Poof]
pierpal has joined #racket
endformationage has joined #racket
meepdeew has quit [Remote host closed the connection]
dustyweb has quit [Remote host closed the connection]
meepdeew has joined #racket
mzan has quit [Quit: Leaving.]
zedoary has quit [Quit: No windows for this server]
Sgeo_ has quit [Read error: Connection reset by peer]
Sgeo_ has joined #racket
rnmhdn has joined #racket
fmnt has quit [Quit: Leaving.]
orivej has quit [Ping timeout: 272 seconds]
fmnt has joined #racket
fmnt has quit [Quit: Leaving.]
rnmhdn has quit [Ping timeout: 250 seconds]
FreeFull has joined #racket
YuGiOhJCJ has joined #racket
jao has joined #racket
jao has quit [Ping timeout: 250 seconds]
orivej has joined #racket
obfusk has joined #racket
orivej has quit [Ping timeout: 250 seconds]
notzmv has quit [Ping timeout: 245 seconds]
orivej has joined #racket
pie_ has joined #racket
notzmv has joined #racket
meepdeew has quit [Remote host closed the connection]
pierpa has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
orivej has quit [Ping timeout: 245 seconds]
dmiles has quit [Ping timeout: 246 seconds]
dmiles has joined #racket
pie_ has quit [Ping timeout: 250 seconds]
pie_ has joined #racket
meepdeew_ has joined #racket
pie_ has quit [Remote host closed the connection]
pie_ has joined #racket
pie_ has quit [Remote host closed the connection]
pie_ has joined #racket
orivej has joined #racket
orivej has quit [Ping timeout: 250 seconds]
pie_ has quit [Remote host closed the connection]
pie_ has joined #racket
pie_ has quit [Remote host closed the connection]
pie_ has joined #racket