<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]
<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.
<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).
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?]