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
hjek has quit [Quit: Leaving.]
pierpal has quit [Read error: Connection reset by peer]
ubLIX has quit [Quit: ubLIX]
jmiven has quit [Quit: co'o]
jmiven has joined #racket
Sgeo has joined #racket
Sgeo_ has quit [Ping timeout: 268 seconds]
_whitelogger has joined #racket
iyzsong has joined #racket
winny has quit [Quit: switching servers]
winny has joined #racket
ng0_ has joined #racket
ng0 has quit [Ping timeout: 256 seconds]
ng0_ has quit [Quit: Alexa, when is the end of world?]
_whitelogger has joined #racket
orivej has joined #racket
vraid has quit [Ping timeout: 240 seconds]
g00s has joined #racket
Sgeo has quit [Read error: Connection reset by peer]
Sgeo has joined #racket
acarrico has quit [Ping timeout: 272 seconds]
NB0X-Matt-CA is now known as nonlinear
_whitelogger has joined #racket
nonlinear has quit [Ping timeout: 246 seconds]
rnmhdn has joined #racket
rnmhdn has quit [Client Quit]
rnmhdn has joined #racket
winny has quit [Quit: rebooting]
winny has joined #racket
nonlinear has joined #racket
buyfn has joined #racket
_whitelogger has joined #racket
buyfn has quit [Quit: buyfn]
jao has quit [Ping timeout: 268 seconds]
buyfn has joined #racket
buyfn has quit [Quit: buyfn]
rnmhdn has quit [Ping timeout: 244 seconds]
g00s has quit [Quit: Textual IRC Client: www.textualapp.com]
buyfn has joined #racket
pierpal has joined #racket
buyfn has quit [Quit: buyfn]
<lavaflow> is there a way to create a macro that wraps an identifier with the same name without making it loop recursively?
<lavaflow> requiring the identifier to be wrapped under a different name or something like that I'm guessing?
buyfn has joined #racket
dddddd has quit [Remote host closed the connection]
ym has quit [Remote host closed the connection]
libertyprime has joined #racket
pierpal has quit [Quit: Poof]
pierpal has joined #racket
DGASAU has joined #racket
ng0 has joined #racket
mzan has joined #racket
orivej has joined #racket
gour has joined #racket
buyfn has quit [Quit: buyfn]
buyfn has joined #racket
ZombieChicken has quit [Ping timeout: 256 seconds]
ym has joined #racket
buyfn has quit [Quit: buyfn]
hjek has joined #racket
YuGiOhJCJ has quit [Remote host closed the connection]
YuGiOhJCJ has joined #racket
buyfn has joined #racket
rnmhdn has joined #racket
<rain1> sorry lavaflow cant really understand your question
<rain1> would you like to show an example?
<lavaflow> like if I wanted to create a macro called string. string already exists of course
<rain1> well you can still name it string
<rain1> it will just shadow the previous string
<lavaflow> what if one of the things that macro might expand to is string?
<lavaflow> would that expansion start expanding recursively, or would it expand to the old string?
<lavaflow> specifically what I'm trying to do is make (string x:string ...) behave like (string-join (x:string ...) "\n")
<rain1> if you define a macro called string, then later use the macro - and that expands into something called string - then it will shadow a second time and new mentions of string will refer to the expanded thing
<rain1> why don't you define this macro in a module that does not import the string variable?
<rain1> then you don't need to worry about any of this shadowing stuff at all
<lavaflow> hmm, I'll try that
gour has quit [Ping timeout: 244 seconds]
buyfn has quit [Quit: buyfn]
gour has joined #racket
buyfn has joined #racket
hjek has quit [Quit: Leaving.]
DGASAU has quit [Ping timeout: 264 seconds]
hjek has joined #racket
orivej has quit [Ping timeout: 272 seconds]
dddddd has joined #racket
buyfn has quit [Quit: buyfn]
iyzsong has quit [Read error: Connection reset by peer]
acarrico has joined #racket
joebobjoe has joined #racket
<joebobjoe> is this true (from https://docs.racket-lang.org/reference/reader.html#%28part._parse-quote%29) that 'apple
<joebobjoe> reads equal to
<joebobjoe> (list 'quote 'apple)
<joebobjoe> (sorry about line spam)
<joebobjoe> I do a (length 'apple) and I get an exception
<hjek> (string-length (symbol->string 'apple))
<joebobjoe> what?
<hjek> length takes a list as arg, right?
<hjek> you're passing in a symbol.
<joebobjoe> the documentation says: "'apple reads equal to (list 'quote 'apple)"
<joebobjoe> so I'm passing in a list
<joebobjoe> it should work
dbmikus has joined #racket
<hjek> i think the docs are wrong
<hjek> 'apple and (quote apple) are similar
<hjek> but surely not (list 'quote 'apple)
<hjek> but (eval (list 'quote 'apple)) is the same
<hjek> (eval (list 'quote 'apple)) is the same as 'apple and (quote apple)
<hjek> i think when they say "reads equal to" they don't mean that they are the same
<hjek> they mean that it's the same, once it's been read, i.e. parsed to eval
<hjek> maybe a bit of a funny wording in the docs
<hjek> but perhaps not "wrong" as such
<joebobjoe> I still don't know what "reads equal to"
<hjek> joebobjoe: foo reads equal to bar, if (eval bar) is foo.
<hjek> i think
<hjek> either it's a bad wording, or it's wrong though
<joebobjoe> it's just weird because right above it says "'s can be used as a shorthand for (quote s)"
<hjek> that's correct
<hjek> I think the docs are misleading here
longshi has joined #racket
<hjek> I'm just trying to stretch the meaning of them to something that could be true
<hjek> but they certainly look wrong, yes
<joebobjoe> ok I think I know what's up
<joebobjoe> raket has a two step thing, read then parse
<joebobjoe> I think the docs are right it's just confusing without any context
<joebobjoe> I was linked from https://docs.racket-lang.org/guide/quote.html (near the bottom)
<joebobjoe> from that page: "The syntax of a datum is technically specified as anything that the read function parses as a single element. The value of the quote form is the same value that read would produce given datum."
<joebobjoe> ohhh, so read produces quote forms
<joebobjoe> so of course a 'apple read by read will turn into a ''apple
<joebobjoe> ''apple is equal to (list 'quote 'apple)
<joebobjoe> I don't know how read works but I'll learn more soon
<bremner> hmm. This reminds me of a recent discussion about quote and list.
dbmikus has quit [Ping timeout: 246 seconds]
longshi has quit [Quit: WeeChat 2.3]
jao has joined #racket
buyfn has joined #racket
orivej has joined #racket
orivej has quit [Ping timeout: 244 seconds]
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
buyfn has quit [Quit: buyfn]
buyfn has joined #racket
audriu has joined #racket
<greghendershott> joebobjoe: I'm not sure I'd say it's 2 step, read then parse. More like: `read` _is_ a parser.
<greghendershott> joebobjoe: Maybe more helpful if you start here https://docs.racket-lang.org/reference/reader.html#%28part._parse-symbol%29
<greghendershott> reading the characters "Apple" produces a symbol Apple, the default printer will print as 'Apple
<greghendershott> which is shorthand for (quote Apple)
<greghendershott> so reading the characters "'Apple" or "(quote Apple)" both produce...
rnmhdn has quit [Ping timeout: 252 seconds]
hjek has quit [Ping timeout: 246 seconds]
hjek has joined #racket
badkins has quit [Ping timeout: 250 seconds]
Sgeo has quit [Ping timeout: 240 seconds]
Sgeo has joined #racket
<joebobjoe> greghendershott: thanks
audriu has quit [Quit: Leaving]
<joebobjoe> I was just going bassed off https://docs.racket-lang.org/guide/Pairs__Lists__and_Racket_Syntax.html#%28part._lists-and-syntax%29
acarrico has quit [Ping timeout: 246 seconds]
acarrico has joined #racket
<greghendershott> joebobjoe: This by lexi-lambda also super helpful: https://stackoverflow.com/questions/34984552/what-is-the-difference-between-quote-and-list
rnmhdn has joined #racket
nonlinear has quit [Ping timeout: 252 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #racket
vraid has joined #racket
<joebobjoe> is there any way to write this better? https://paste.pound-python.org/show/swH2SUIbLWmytH7bTMFp/
pierpal has quit [Quit: Poof]
pierpal has joined #racket
<joebobjoe> seems to take up a lot of columns (new racketeer)
<hjek> i'd use let to define the env, and also use map to iterate
<hjek> give me a minute
<joebobjoe> why map? I don't care about the result
<joebobjoe> I just want the side effect
<hjek> still
<joebobjoe> there is no map for environment-variables
ZombieChicken has joined #racket
<hjek> ah ok, it's a funny data structure. your way of writing it looks fine
orivej has joined #racket
<joebobjoe> so racket code usually has that many english words taking up horizontal space?
<hjek> joebobjoe: Racket can be really verbose, e.g. compared to Clojure
<hjek> or JS
<hjek> conversions are always very specific
<hjek> someone on this channel mentioned ~a though, which is really useful for making strings out of stuff
<hjek> (~a "different" '(things (mixed)) 'together 1 )
<hjek> because sometimes you just want to print things regardless of their type and whatnot
<rain1> wow those are very long
<rain1> I don't think there's much you can do about it!
<rain1> (just looked at th epaste)
buyfn has quit [Quit: buyfn]
audriu has joined #racket
audriu has quit [Quit: Leaving]
audriu has joined #racket
libertyprime has quit [Remote host closed the connection]
davidl has joined #racket
pie_ has joined #racket
<greghendershott> joebobjoe: Normally I use getenv and putenv to get or set individual env vars
pie_ has quit [Remote host closed the connection]
<greghendershott> But I've never needed to do something like "nuke all the env vars" like you seem to want to be doing here?
pie_ has joined #racket
<greghendershott> A common idiom (I think) is `(define setting (or (getenv "SETTING") 42))` where 42 is the default.
<greghendershott> I wouldn't say it's common for Racket to be so "horizontally verbose" -- although those env functions certainly happen to be.
<greghendershott> It's fine to define local helper functions that might have less-verbose names or better fit the "local shape" of things you're working with.
<greghendershott> The module system is also super flexible with `require` options like `rename-in`, `prefix-in`, and so on.
<greghendershott> There are also the usual suspects in functional programming like curry, curryr, threading macro, cut, fancy-app, and so on.
<greghendershott> joebobjoe: TL:DR; Racket code can be as verbose or terse as you prefer for the intended audience (e.g. just you, your dev team, whoever).
gour has quit [Quit: Konversation terminated!]
gour has joined #racket
zmt00 has quit [Ping timeout: 250 seconds]
joebobjoe has quit [Ping timeout: 272 seconds]
gour has quit [Quit: Konversation terminated!]
<hjek> anyone has any idea how the scribble markdown renderer works? finding the docs hard to understand: https://docs.racket-lang.org/scribble/renderer.html?q=markdown#(part._.Markdown_.Renderer)
orivej has quit [Ping timeout: 250 seconds]
hugo has quit [Ping timeout: 272 seconds]
joebobjoe has joined #racket
rnmhdn has quit [Ping timeout: 245 seconds]
ubLIX has joined #racket
libertyprime has joined #racket
audriu has quit [Quit: Leaving]
jcowan has quit [Quit: Connection closed for inactivity]
pie_ has quit [Remote host closed the connection]
pie__ has joined #racket
Sgeo_ has joined #racket
pie__ has quit [Excess Flood]
Sgeo has quit [Ping timeout: 240 seconds]
pie__ has joined #racket
<joebobjoe> greghendershott: I can't curry the environment set because it changes. is it possible to curry in something that evaluates (current-environment-variables) for the parameter each time the curried function is invoked?
vraid has quit [Ping timeout: 246 seconds]
<lexi-lambda> joebobjoe: At that point, you probably just want a lambda.
hugo has joined #racket
ng0 has quit [Quit: Alexa, when is the end of world?]
joebobjoe has quit [Ping timeout: 250 seconds]
ubLIX has quit [Quit: ubLIX]
joebobjoe has joined #racket
joebobjoe has quit [Ping timeout: 244 seconds]
joebobjoe has joined #racket