tonyg changed the topic of #racket to: The Racket Programming Language -- https://racket-lang.org/ -- https://gather.town/app/wH1EDG3McffLjrs0/racket-users -- http://pasterack.org -- logged at https://libera.irclog.whitequark.org/racket/ -- This is the right place to ask for help with (Dr)Racket. Remember to wait around for an answer!
Tuplanolla has quit [Quit: Leaving.]
szkl has joined #racket
to-hu has joined #racket
Tuplanolla has joined #racket
skapata has quit [Remote host closed the connection]
szkl has quit [Quit: Connection closed for inactivity]
ormaaj has joined #racket
polarian has joined #racket
<polarian> Hello, I am having issues finding how to store variables within the scope of a function/procedure. define is global, and will not work within lambda, let requires a *body* which goes out of scope and thus I can't return the value I calculate within the let block...
<polarian> also this is not bridged to discord... right?
<polarian> There is no warning within the channel for messages leaked to other platforms, so I am going to go with no...
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #racket
<dzoe> polarian: what are you trying to achieve?
<dzoe> (define myproc (let ((x 1)) (lambda () (set! x (add1 x)) x)))
<dzoe> Something like this?
<polarian> dzoe: read a file, and then I want to parse some of the content, so I need to store it as I need to extract multiple things which cant be chained in a single expression. But if I use let, the parsed content will not be returned as the last evaluation would be "let" and thus the return value is void
<polarian> I need some way of keeping the content of reading a file, within the scope of the entire function so that the final evaluated instruction is the return value
<dzoe> (define (myproc) (let ((data (port->string))) ... return-value))
hl has quit [Quit: ZNC - https://znc.in]
hl has joined #racket
<polarian> dzoe: I cant remember the error fully but it tells me it expects a function
<polarian> oh wait nevermind let me try this again thanks
ormaaj has quit [Quit: :)]
ormaaj has joined #racket
ormaaj has quit [Quit: :)]
to-hu has quit [Ping timeout: 276 seconds]
ayushnix has joined #racket
ormaaj has joined #racket
ormaaj has quit [Max SendQ exceeded]
ormaaj has joined #racket
rakka has quit [Remote host closed the connection]
rakka has joined #racket
skapata has joined #racket
lucasta has joined #racket
ns12 has quit [Quit: bye]
ns12 has joined #racket
Achylles has joined #racket
Achylles has quit [Quit: Leaving]
Achylles has joined #racket
Achylles has quit [Max SendQ exceeded]
lucasta has quit [Quit: Leaving]
shawnw has joined #racket
<polarian> () and [] both work, how to determine when to use []? is there some sort of convention for this?
lucasta has joined #racket
<polarian> ah that makes sense thank you...
<polarian> https://bpa.st/3UHA so void issues again... i is a struct, I have checked by displaying a struct that the right struct is being found, and it outputs the name
<polarian> but I cant get it to reutrn
<polarian> return*
<polarian> its always void... is that due to the cons?
<polarian> s/cons/cond
<polarian> coming from a procedural language with "return" keyword seems to be really messing up my chain of thoughts...
<polarian> apologies for being verbose in this channel today :(