orivej has quit [Read error: Connection reset by peer]
orivej has joined #racket
lockywolf_ has quit [Ping timeout: 256 seconds]
lockywolf has joined #racket
lockywolf has quit [Max SendQ exceeded]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
lockywolf has quit [Max SendQ exceeded]
lockywolf has joined #racket
pilne has quit [Quit: Tis but a scratch]
ArthurStrong has joined #racket
sz0 has joined #racket
endformationage has quit [Quit: WeeChat 2.6]
lockywolf_ has joined #racket
lockywolf__ has joined #racket
lockywolf has quit [Ping timeout: 240 seconds]
lockywolf__ has quit [Max SendQ exceeded]
lockywolf__ has joined #racket
narimiran has joined #racket
lockywolf__ has quit [Max SendQ exceeded]
lockywolf__ has joined #racket
lockywolf_ has quit [Ping timeout: 256 seconds]
ArthurStrong has quit [Quit: leaving]
sauvin has joined #racket
dddddd has quit [Ping timeout: 256 seconds]
ecraven has quit [Quit: bye]
ecraven has joined #racket
selimcan has joined #racket
<sarna>
hello, is it possible to redefine stuff in racket without restarting the whole application? for example adjusting player's speed while the game is running
<sarna>
this sort of thing is possible in clojure and cl
Sgeo_ has joined #racket
Sgeo__ has quit [Ping timeout: 256 seconds]
<selimcan>
I'm a newbie to racket, but I think that the standard answer to that question is that the 'top-level is hopeless' ^^
<evdubs>
sarna - are you trying to call set! ?
<sarna>
:(
<sarna>
evdubs: no, for example I'd like to recompile a `define` with a new player speed
<sarna>
and ideally now the player would have the new speed without me reopening the game window
<selimcan>
From what I understood from a video called "A Guiler's year of Racket", that's probably not possible in Racket, but I might be wrong
<sarna>
aw heck
<sarna>
I'd like to make a game and I'm weighing my options rn
<sarna>
and I don't really want to do this `close game -> recompile -> open game -> go to level five -> check if my change was good or not` dance
<sarna>
evdubs: you can't redefine stuff in the standard modules, right?
<evdubs>
sarna, probably not without stop / edit / compile / launch loops
<evdubs>
but i don't know how far the top level rabbit hole goes
<sarna>
evdubs: that sounds reasonable, I never had to redefine code that wasn't mine (yet)
<mingy>
my question is can I mkdir in my home folder and use"raco pkg update --no-setup --catalog https://pkgs.racket-lang.org <PKG>" to clone the drracket to that folder?
urbanslug has quit [Ping timeout: 265 seconds]
jellie has joined #racket
<evdubs>
mingy, looks like that should work - what happens when you do that?
dzoe has quit [Ping timeout: 265 seconds]
<evdubs>
also, mingy, does racket 7.6 help your chinese input issue?
<mingy>
yes,it is
<mingy>
but my friend ask me to find the bug by myself..and I don't how to begining.
<mingy>
In my experience using c ++, I know that the code will be compiled into assembly language, and then I can debug it with the pdb or something , and I have know that the rtk code will be compiled into bytecode, but I don't know how to debug
<mingy>
sorry,not"compiled into assembly language".
<evdubs>
is it possible to just ignore that this was a bug and not do any debugging?
<evdubs>
dr racket and emacs both let you run programs, insert breakpoints, and evaluate expressions while a program is paused
<evdubs>
debugging a program like dr racket, when you don't have much experience debugging racket programs and probably have little familiarity with dr racket will probably be very time consuming and difficult
<mingy>
thanks for reply!.emmm first question:"and use the "raco install" to download the package from net, so I can't just download the drracket source folder and compile it ,right?"
<mingy>
and ,"I can't just download the source and us some command tool to make in to execuatble I cannot specify a path to my download folder,right"
<mingy>
Sorry I just want to confirm.,I know this is a meaningless thing..
<evdubs>
i think it's recommended to use the paco pkg update approach to clone (download) the repository
<evdubs>
maybe you can also manually download it or git clone it and link to it somehow
<evdubs>
raco pkg update*
<sarna>
evdubs: this approach doesn't work with the gui library :( when I redefine the module, the window doesn't update
<evdubs>
sarna, do you have some way to refresh the window's contents?
<mingy>
thanks.I will look the "raco pkg update" keyword on google and learn how to use it
<sarna>
evdubs: dunno, I don't know racket :) I'll try some googling
<evdubs>
mingy, are you on windows?
<mingy>
yes,windows 10 2004
<evdubs>
mingy, i think i had some trouble in the past trying to build racket packages in windows but maybe you'll have more success
<evdubs>
it's been a lot easier for me on linux
<evdubs>
for what it's worth
<mingy>
do you mean "build racket"?
<sarna>
`(send frame refresh)` doesn't work, that's a bummer
<evdubs>
sarna, with gui components, i think you can just call set-element (like set-label) to update values
<evdubs>
maybe that can be workable?
<sarna>
evdubs: oh, that works fine
<sarna>
that could actually be good enough for me, while at the same time saving me from cl's cache invalidation issues ("I swear I recompiled this.. why is it using the old version again")
<sarna>
thank you :)
<evdubs>
good luck
<evdubs>
if you find yourself in some workflow, maybe it'll be nice to post to racket-users to share your experience
<evdubs>
i think this sort of thing drives people to use other language environments that are seen as being more friendly with respect to live codeing
<evdubs>
coding*
Naptra has joined #racket
<sarna>
yeah, interactivity is a big part of the lisp experience ™️ for me
<evdubs>
mingy, yes. mflatt will be the best person to work with
<ecraven>
sarna: unfortunately, I haven't found *any* Scheme (or Racket) that comes even close to what CL does :-/
<ecraven>
of course, high interactivity leads to its own problems
<sarna>
ecraven: I experimented with MIT/GNU scheme, but it's really buggy and less interactive than CL
<sarna>
ecraven: it's nice when it works. when it doesn't, I hate it
<sarna>
same with everything in programming tbh :D
<ecraven>
sarna: hm.. I haven't found it to be buggy, it used to be my main Scheme. but it is the most CL-like of all the Schemes I tried
<ecraven>
for example, it's the only one I found where you can "enter" a package and redefine things
<sarna>
ecraven: really? sometimes after resuming after a restart it continued to eat up 100% of cpu for me.. maybe it was a geiser issue
<ecraven>
not sure, that happens to me sometimes, but not often.. but good point, that would nicely fit the category "buggy" ;)
<sarna>
at least it's reproducible ;)
<mingy>
Do you mind if I send a lot of stuff.(nine line)
<greghendershott>
2. The things it relies on in Racket are pretty basic/stable, AFAIK.
<greghendershott>
3. Mostly it is "only" a "wrapper" around dynamic-reqrequire, as the README says. But things you'd rather not everyone write form scratch over and over.
<greghendershott>
4. If you hit a bug I bet Tony would fix it, or, someone else like me might volunteer to help. Or you might be able to, in those 117 lines, asking here or on mailing list.
<greghendershott>
5. fin :)
<greghendershott>
Some of the best Racket packages haven't been updated in years because they're focused well, and Racket hasn't broken them.
<greghendershott>
Like you my eyebrows would at least raise if I saw "5 years", and it's not all rainbows and unicorns in Racket land. But.
<greghendershott>
If the package is well-focused and a good author like Tony, it's not unrealistic it's not crazy that it might be fine.
<sarna>
greghendershott: tried it out, it doesn’t really work.. I tried their website example - I could only update the “configurable text” bit, nothing else
<sarna>
and the “last reload” section wasn’t updated on reloads
<sarna>
I really want to like racket, I really do - CL is old and ugly.. but in racket I just keep running into walls :/
selimcan has quit [Ping timeout: 264 seconds]
<greghendershott>
MustardCheese: A non-macro answer would be to do (define num-val (delay (long-operation num)) at the start of the function, and (force num-delay) where needed within a normal cond.
<greghendershott>
But as for the macro.
<greghendershott>
IIUC your grammar is each clause can be a let or a normal cond clause.
<greghendershott>
And so you might want some syntax-class that expresses that?
<MustardCheese>
delay/force looks like a good solution
<MustardCheese>
as for the syntax class, is there something that allows me to merge two syntax classes?
<greghendershott>
Yeah I didn't know if you wanted to solve that problem per se, or, it was an example for learning how to write such a macro
<greghendershott>
One syntax class can have multiple patterns, see that link, I think it's relevant
<MustardCheese>
That way I could define a 'cond' pattern, a 'let-cond' pattern and a third pattern which could be either of those
<greghendershott>
Well I thought you'd have a `cond-clause` syntax class, with one pattern for each of the two
<greghendershott>
But, I haven't really thought it through, since the let clause means you need to nest an entire other cond in that
<greghendershott>
I don't really know the answer, just pointing to some pieces that may or may not help
<greghendershott>
It might also be simpler to write this, at least version 1, where it expands directly into nested `if`s, like plain `cond` would? At least that's a tactic to keep in mind.
<greghendershott>
Also what you describe tickles my memory, like I think someone has already written this, or I've seen it discussed. If you wanted to google and "peek at the answer" :)
selimcan has joined #racket
<MustardCheese>
Uhm so yes this is more of a 'figuring out syntax/parse' more than anything serious, although I will use the macro once it works properly.
fiddlerwoaroof_ is now known as fiddlerwoaroof
orivej has joined #racket
jmiven has quit [Quit: reboot]
cky has quit [*.net *.split]
cky has joined #racket
jmiven has joined #racket
lavaflow has joined #racket
libertyprime has joined #racket
<MustardCheese>
Is it not possible to use syntax/parse syntax patterns (such as ~or*, ~alt) within 'pattern' closures (such as (pattern (a:expr b:string)))?
<greghendershott>
MustardCheese: Sure. But also, successive `pattern`s are effectively "or"/"alt": Try each until one matches. Just like in "plain" syntax-parse (or syntax-case or syntax-rules) patterns.
<greghendershott>
Anyway I played with this a bit. I think if you write a simple `my-cond` that expands to nested `if`s, that takes a couple syntax-parse clauses. Don't even need syntax classes, really.
<greghendershott>
And once that's working, you can add a third clause for the "let" feature.
emacsomancer has quit [Read error: Connection reset by peer]
<greghendershott>
At least I have a quick/dirty thing, where that was true.
<greghendershott>
I can either share my bad code, or not, if you'd rather work at it yourself.
<greghendershott>
Caveat: I go weeks or months where I don't write any non-super-trivial Racket macros, so I'm always rusty, and not always up to speed on the latest/best ways to do things. :)
<MustardCheese>
Haha
<MustardCheese>
I deliberately tried to delegate as much work to cond as possible as I know the original implementation will be much better than anything I made
emacsomancer has joined #racket
<MustardCheese>
In spite of that, I'd be happy to re-implement it for the time being just for the sake of a working prototype
libertyprime has quit [Read error: No route to host]
<greghendershott>
Oops I meant to use "...+" a.k.a. one or more in that first pattern, not "...".
jmiven has quit [Client Quit]
jmiven has joined #racket
<MustardCheese>
Did you?
<MustardCheese>
Ah of course, to force usage of the #:else pattern
<greghendershott>
Yes I was just about to type that. :)
<greghendershott>
You could do it differently of course.
libertyprime has joined #racket
<greghendershott>
I just consider that an unfortunate feature of real `cond`, so I'd want to fix that in one I wrote.
<greghendershott>
But just my opinion. You could add a clause that matches (_) and emits #'(void) I guess.
<greghendershott>
So the nesting means I think it's possibly tricky to write one that expands into `cond` if you try to "handle the whole thing at once".
<greghendershott>
I think maybe have your cond expand into nested real `cond`s, would help?
<greghendershott>
And then it's features like `=>` or whatever should work fine.
<greghendershott>
* its features
<greghendershott>
Not sure if I explained that well? I just meant it's probably too tricky to make your single cond expand into one single real cond, so don't even try.
<greghendershott>
At least that's my hand-wavy intuition/guess.
<MustardCheese>
The original one I posted in that pastebin link works the way you just described - it creates a cond, stuffs every expression into there until it hits a pattern that starts with either 'let' or 'let*'.
<MustardCheese>
It then appends an 'else' clause to the current cond, adds the let and then starts a new cond
<MustardCheese>
It continues until it runs out of usages of 'let', dumping the rest of the exprs at the end of the most nested cond
<greghendershott>
You're not locked into `let`; it can be any form, including any match binding form.
<samth>
sarna: for gui development, you may have to explicitly invoke update functions of some kind when things change -- if you do something like this (new button% [label e]) and then you re-load the definition of `e`, nothing will change in the button
jellie has joined #racket
sauvin has quit [Read error: Connection reset by peer]
jellie has quit [Ping timeout: 260 seconds]
<sarna>
samth: I couldn’t find them! adding new stuff and updating labels works just fine, but removing/updating doesn’t :(
<sarna>
(I tried updating, I couldn’t find anything for removing)
<samth>
sarna: can't you update to the empty label?
pounce has joined #racket
meimeix has joined #racket
Codaraxis__ has joined #racket
libertyprime has quit [Ping timeout: 260 seconds]
Codaraxis_ has quit [Ping timeout: 256 seconds]
efm has quit [Ping timeout: 265 seconds]
<sarna>
samth: not sure what you mean by that
<samth>
sarna: if you're trying to change the label of a button, you need to call `set-label`. if you want to remove the label, I think you'd call set-label with the empty string.
<sarna>
samth: ah, I see. how do I remove a button from a window for example?
<sarna>
I couldn’t find a function for that
<sarna>
s/window/frame
efm has joined #racket
<samth>
sarna: I think you want `delete-child`
<sarna>
samth: oh sweet. that would totally work
<sarna>
seems like I was approaching this from a wrong angle
<sarna>
I’ll try again tomorrow. thanks :)
srji has quit [Quit: leaving]
miskatonic has joined #racket
efm has quit [Ping timeout: 256 seconds]
MustardCheese has quit [Quit: Quit]
narimiran has quit [Quit: leaving]
evdubs has quit [Quit: Leaving]
evdubs has joined #racket
efm has joined #racket
Lowl3v3l has joined #racket
Naptra has quit [Remote host closed the connection]
nullcone has joined #racket
rmnull has joined #racket
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
rmnull has quit [Client Quit]
rmnull has joined #racket
dddddd has quit [Ping timeout: 256 seconds]
true-grue has quit [Read error: Connection reset by peer]