In a reddit post (https://www.reddit.com/r/Racket/comments/p9jr6e/problem_with_getting_min_value_from_list_of/), user bjoli made a point that (apply min xs)
is going to be slower than a let loop that computes the minimum of xs
manually. This appears to be true in Racket CS, but the opposite is true in Racket BC:
RacketCS (8.2)
apply: 260ms
let loop: 28ms
RacketBC (7.9)
apply: 102ms
let loop: 489ms
Is there any room of improvement for RacketCS’s apply
?
I think what you’re seeing with very large lists is that rest-arg handling in min
has to reconstruct a list of arguments that was copied to an argument stack; BC’s min
uses the arguments directly from an argument stack, just because min
is primitive enough. Compare with (define min (lambda args 0))
, where the compiler sees that args
is not used, so no list is re-created.
If I remember correctly, this paper is about an alternative: https://dl.acm.org/doi/10.1145/62678.62689
I have a text%, I highlighted a URL, or a filename, or an ID number. I made a popup-menu so I can do things like Visit URL, Visit File, Look Up ID, … When I right-click to bring up the popup, the highlight on the text goes away. Is there a way I can keep it? I need to keep the selection alive for what the popup will want to do with it.
How do you activate the popup menu? Does the selection actually go away (e.g. because you are clicking somewhere and the even goes through to the text% object and the selection changes) or does it just not render because of the focus loss?
if any of you guys are teachers here, can you send me some of the buggy/crashy student code that doesnt work? Just zip up a whole semesters worth? i’m making a programming course based off of HTDP2E and i’d like real world examples of what happens when they dont follow the design recipe
Are there known issues with DrRacket/racket/gui
on Wayland? I’m finding, for example, that I can paste into DrRacket, and I can copy and paste within DrRacket, but I can’t paste from DrRacket to other applications. Specifically I’m on KDE, and it is very possible there could be issues with my local setup, but I thought I’d ask before I dig in much more deeply.
No issues for me, I’m on sway(i3) on arch linux running wayland
can copy between between both just fine
try installing that ^
would you be willing to share the code you get? I’m making a static analysis tool and real world examples of buggy code would be great for mining tool improvements
hard to tell what applications are running on pure wayland or on xwayland compatibility layer
yeah no problem, hope some are willing to send
@notjack for a large-ish code base by a new-ish racket user, see https://github.com/benknoble/slack-archive-viewer; improvements welcome. (There are some design issues with the current implementation, but that shouldn’t affect it as an interesting place to try your tool.)
I’m capturing the event ’right-up in the text%. When I right-click after choosing some text, the highlighting vanishes. I didn’t actually check to see if the selection start and stop were still valid, but I’ll do that.
Is DrRacket an XWayland application? Copy-paste between XWayland and Wayland apps is still a work-in-progress in KDE.
As far as I can tell (with xwininfo
) it is on Wayland, as are Konsole and Kate (two apps I tried to paste into).
But it does seem weird, because DrRacket mouseover tooltips are displaying in new windows.
To be even more specific, I’m trying this on Kubuntu 21.04 with the Kubuntu backports PPA, which gives me Plasma 5.22.4 and KDE Frameworks 5.85.0.
One way my local setup might be weird is that this is DrRacket installed via Guix, and thus linked against Guix’s GTK etc. rather than the system’s.