lexi-lambda changed the topic of #racket to: Racket v7.2 has been released: https://blog.racket-lang.org/2019/01/racket-v7-2.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
evdubs has quit [Remote host closed the connection]
evdubs has joined #racket
dustyweb has joined #racket
<greghendershott> dzoe: You're trying to set! the thing in the same module it's defined, and, it fails silently?
<greghendershott> (As you know in general you can't set! something outside the module that provides it. But that gives you a clear error like "set!: cannot mutate module-required identifier".)
keep_learning has quit [Remote host closed the connection]
<greghendershott> A plain old contract still lets you set! within the same module. e.g. (define/contract v number? 42) and (set! v 43) is fine. (And (set! v "foo") gives you contract failure.)
<greghendershott> I wonder if srcdoc is moving you define into a submodule then providing it.
<greghendershott> Anyway, my lazy/"practical" answer is don't use set!. Instead use e.g. (define current-v (make-parameter 42)) and then I bet (current-v 43) will work fine with srcdoc?
<greghendershott> It might be that srcdoc ought to be changed to accomodate set!, or it might be the design makes it hard. idk.
<greghendershott> I think the reality is not a huge number of people use srcdoc (but I have, and like it!), and of those, people are probably being "Rackety" and using parameters or boxes or whatever to mutate.
<greghendershott> So that small % of a % might be why "nobody" except you has noticed this? idk
<greghendershott> Or hopefully someone smarter will come along with a better answer for you than mine.
ZombieChicken has quit [Ping timeout: 256 seconds]
<greghendershott> "I wonder if srcdoc is moving you define into a submodule then providing it." No, these are just provide sub-forms.
Fernando-Basso has quit [Remote host closed the connection]
<greghendershott> Without knowing more, all I can figure is you're hitting the basic thing, that anything a modules `provide`s can't be mutated outside the module.
ZombieChicken has joined #racket
ubLIX has quit [Quit: ubLIX]
zmt01 has quit [Quit: Leaving]
zmt00 has joined #racket
AzNh12P has joined #racket
AzNh12P has left #racket [#racket]
keep_learning_M has quit [Ping timeout: 250 seconds]
FreeFull has quit []
keep_learning_M has joined #racket
caltelt_ has joined #racket
pera has quit [Ping timeout: 252 seconds]
dddddd has quit [Quit: Hasta otra..]
efm has joined #racket
keep_learning has joined #racket
efm has quit [Ping timeout: 264 seconds]
pera has joined #racket
reverse_light has joined #racket
endformationage has quit [Quit: WeeChat 2.4]
libertyprime has quit [Ping timeout: 264 seconds]
pera has quit [Ping timeout: 246 seconds]
caltelt_ has quit [Ping timeout: 255 seconds]
orivej has quit [Ping timeout: 252 seconds]
jao has joined #racket
jao has quit [Ping timeout: 264 seconds]
evdubs has quit [Remote host closed the connection]
evdubs has joined #racket
cemerick has quit [Read error: Connection reset by peer]
cuyler has quit [Read error: Connection reset by peer]
cuyler has joined #racket
cemerick has joined #racket
<dzoe> greghendershott: exactly
<dzoe> And btw, I just export a different symbol now and hide the mutation strictly inside the module.
<dzoe> What made me flummoxed was the fact that it "silently fails" if I set! the contract-exported identifier within the module.
<dzoe> (As seen from outside of the module)
<dzoe> I switched to parameters for identifiers with atomic values for other reasons as well, but this one is actually a generated function for which I wanted a contract.
ng0 has joined #racket
liangchao has joined #racket
<liangchao> Hi
jao has joined #racket
orivej has joined #racket
keep_learning has quit [Remote host closed the connection]
vraid has joined #racket
reverse_light has quit [Ping timeout: 264 seconds]
ng0 has quit [Quit: Alexa, when is the end of world?]
jao has quit [Ping timeout: 252 seconds]
liangchao has quit [Remote host closed the connection]
dddddd has joined #racket
iyzsong has joined #racket
jao has joined #racket
ZombieChicken has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #racket
orivej has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 264 seconds]
acarrico has joined #racket
orivej has joined #racket
badkins has joined #racket
davidl has quit [Ping timeout: 268 seconds]
q9929t has joined #racket
mSSM has joined #racket
q9929t has quit [Quit: q9929t]
dan_f has joined #racket
<greghendershott> dzoe: It's not unusual to have parameters whose value is a function. `current-eval` and `current-print` are just a couple examples. Also parameter/c is a thing.
<greghendershott> Admittedly `(f x y z)` is more convenient than `((current-f) x y z)` but if you do the latter a lot you can wrap that in some call-the-current-f function maybe you even name it `f`
dimitarvp has joined #racket
ng0 has joined #racket
pera has joined #racket
dimitarvp has quit [Read error: Connection reset by peer]
pera has quit [Ping timeout: 264 seconds]
efm has joined #racket
efm has quit [Ping timeout: 264 seconds]
endformationage has joined #racket
iyzsong has quit [Ping timeout: 264 seconds]
vraid has quit [Quit: Leaving]
<jcowan> What I want to know is, does anyone know any applications of parameters that goes beyond just storing them in global variables?
<dzoe> greghendershott: good example, thanks - I have just started writing some serious web application in Racket so these are basically insweeped corners for me
<dzoe> (Been writing batch and GUI applications in Racket for years)
pera has joined #racket
vraid has joined #racket
<greghendershott> dzoe: btw I've found it handy to have a `config.rkt` with parameters for various app things (ports, db connections, etc.) and the parameter default value comes from `getenv`.
<greghendershott> If you have more than a few, that's a little tedious so I usually make a little macro like this: https://gist.github.com/greghendershott/e73c4eecba9dd19c5759499cb272e8d5
<greghendershott> That might be overkill for simple web apps, or not exactly how you'd want it to work, but just FYI an idea
<greghendershott> Oh the `secret?` bit is just a fence to help scrub certain things from getting into log files.
selimcan has joined #racket
pera has quit [Ping timeout: 255 seconds]
<samth> jcowan: are you asking "why are all parameters defined at the top level of some module"?
pera has joined #racket
ubLIX has joined #racket
Sgeo__ has joined #racket
Sgeo_ has quit [Ping timeout: 245 seconds]
orivej has quit [Ping timeout: 252 seconds]
<dzoe> greghendershott: I was thinking about similar approach for the configuration, my struggle with srcdoc was mainly for the stuff generated by dispatch-rules and similar (recursive syntax macro menu tree builder is the second case)
<dzoe> The dispatch function gets generated relatively lately after all modules have already been initialized - so basically it is just a single mutation during the whole program run. More like "lazy" initialization.
ZombieChicken has joined #racket
selimcan has quit [Ping timeout: 240 seconds]
FreeFull has joined #racket
davidl has joined #racket
dan_f has quit [Quit: dan_f]
dan_f has joined #racket
jao has joined #racket
dan_f has quit [Quit: dan_f]
ubLIX has quit [Quit: ubLIX]
ym555 has joined #racket
dustyweb has quit [Ping timeout: 250 seconds]
ng0 has quit [Remote host closed the connection]
orivej has joined #racket
ng0 has joined #racket
tilpner has quit [Remote host closed the connection]
moldybits has quit [Read error: Connection reset by peer]
tilpner has joined #racket
moldybits has joined #racket
Fernando-Basso has joined #racket
<jcowan> samth: Parameters are first-class objects. You can store them in data structures or local variables return them from functions, as opposed to binding them only to top-level variables. I am wondering if anyone exploits this flexibility.
vraid has quit [Ping timeout: 252 seconds]
jao has quit [Remote host closed the connection]
jao has joined #racket
jao has quit [Disconnected by services]
jao has joined #racket
orivej has quit [Ping timeout: 250 seconds]
vraid has joined #racket
efm has joined #racket
selimcan has joined #racket
mSSM has quit [Ping timeout: 268 seconds]