Re: [racket-users] commenting / uncommenting in DrRacket IDE

2022-07-01 Thread Laurent
On Fri, Jul 1, 2022 at 9:25 AM Hrvoje Blazevic wrote: > Thanks for replying. However, I was not asking for instructions on how to > use DrRacket. Have been using it since the days when HTDP1 was first > printed, and when it was called DrScheme. > But to answer your question in Racket 8.5 and

Re: [racket-users] commenting / uncommenting in DrRacket IDE

2022-07-01 Thread Laurent
After commenting out with a box, place the cursor inside the box then click on the "Racket" menu then on the "Uncomment" item. Now the box should be uncommented without losing anything. Does this not work for you? HTH, Laurent On Fri, Jul 1, 2022 at 5:39 AM Hrvoje Blazevic

Re: [racket-users] Discourse - Mailing list mode

2021-12-10 Thread Laurent
Would it be possible to allow only sending to racket+nos...@discoursemail.com and filtering out those sent to just racket@...? Maybe that could avoid *some* spam. Not sure how effective that would be though. On Fri, 10 Dec 2021, 14:58 Stephen De Gabrielle, wrote: > Thanks to Sam you can now

Re: [racket-users] Anyone successfully filtering Italian spam?

2021-11-30 Thread Laurent
The last 10 spams have all these words in common: https://pastebin.com/BB0arV63 and many more (which I won't copy here for obvious reasons). So you could create a dedicated spam filter that looks for *any* of (not: all of) these words. On Tue, Nov 30, 2021 at 2:10 PM George Neuner wrote: >

Re: [racket-users] Help not working after fresh installation of Racket 8.3

2021-11-25 Thread Laurent
Maybe: raco setup --doc-index On Thu, Nov 25, 2021 at 11:28 AM Stephen De Gabrielle < spdegabrie...@gmail.com> wrote: > My first guess would be to use raco to rebuild the docs - but I can’t > remember the exact command. It’s probably in raco pkg > > > On Thu, 25 Nov 2021 at 10:08, Erich Rast

Re: [racket-users] Adding keybindings to debug

2021-11-02 Thread Laurent
On Mon, Nov 1, 2021 at 11:14 PM James Zollinger wrote: > Thanks for the info, Laurent. I tried the trick outlined in the link you > sent me on Debian 11 versions of Gnome 3.38.5 (just to test this) and MATE > 1.24.1-2 (my preferred environment) without any success. > I haven't

Re: [racket-users] Adding keybindings to debug

2021-10-30 Thread Laurent
On Fri, Oct 29, 2021 at 10:47 PM James Zollinger wrote: > Thank you both for the thoughtful answers. I will take a look at the > quickscript you sent, Laurent. The mac keyboard shortcut is a great > feature. Makes me wonder about buying a mac again after quite a few years. > (I use

Re: [racket-users] Adding keybindings to debug

2021-10-28 Thread Laurent
and "Pause at this point" because these are context menus and the corresponding actions are not accessible programmatically as far as I can tell. The script probably still needs some tweaking. Let me know if you improve it, or if you have issues with it. HTH, Laurent On Thu, Oct 28, 2

Re: [racket-users] Re: Escape continuations for fussy code

2021-10-03 Thread Laurent
Oh well, since everyone is at it, here's my version that no-one asked for. It's similar to parendown, but uses a more standard (but also specific) macro `cond/else` from https://github.com/Metaxal/bazaar/blob/master/cond-else.rkt : (*cond/else* [(*not* (foo? x)) #f] #:else (*define* y (bar x))

Re: [racket-users] Is there a way to format keys/values like raise-arguments-error

2021-09-09 Thread Laurent
Maybe take a look at the text-table package. On Wed, 8 Sep 2021, 14:41 David Storrs, wrote: > raise-arguments-errors produces neatly stacked key/value pairs with > whitespace arranged such that values line up even when keys are of > different lengths. Is there an easy way to get that for

Re: [racket-users] Is it true that 2 side-by-side frames must not be placed within a horizontal-pane because the a frame's parent can only be another frame?

2021-08-09 Thread Laurent
Indeed, you can't put a frame% inside a panel%, if that's what you're asking. (Though I must say I don't see what doing so would mean either, since a frame is a "top-level" widget [image: Screenshot from 2021-08-09 16-43-17.png] .) On Sun, Aug 8, 2021 at 3:11 AM Don Green wrote: > Is it true

Re: [racket-users] raco pkg migrate

2021-07-02 Thread Laurent
I usually use this script: https://gist.github.com/Metaxal/13c4effc483c5ef9f5797ace4950f97a The only drawback I've found so far for my own use cases (unix-wide distribution) is that it won't migrate between snapshots and releases (but it will migrate between snapshots and snapshots, and between

Re: [racket-users] Can I break my racket/gui program be broken down into multiple modules?

2021-06-25 Thread Laurent
I'm not entirely sure what you mean but, just in case, you can indeed export created GUI widgets: file gui1.rkt : ``` #lang racket/gui (provide fr msg) (define fr (new frame% [label "Hear me out"])) (define msg (new message% [parent fr] [label "I have an important message"])) ``` file gui2.rkt

Re: [racket-users] DrRacket complete word more convenient setting

2021-06-17 Thread Laurent
июня 2021 г. в 22:54:55 UTC+3, laurent...@gmail.com: > >> There's a quickscript that does something similar, but not quite what you >> want: >> >> https://github.com/Metaxal/quickscript-extra/blob/master/scripts/dynamic-abbrev.rkt >> It does cycle through completions by p

Re: [racket-users] DrRacket complete word more convenient setting

2021-06-16 Thread Laurent
There's a quickscript that does something similar, but not quite what you want: https://github.com/Metaxal/quickscript-extra/blob/master/scripts/dynamic-abbrev.rkt It does cycle through completions by pressing the same keybinding repeatedly, but it autocompletes only according to the words that

Re: [racket-users] How to recover whitespace from syntax->string

2021-04-09 Thread Laurent
You need to enable line/character counting with `port-count-lines!`: #lang racket (require syntax/to-string) (define in (open-input-string "(comment\n \"hello world\"\n line)")) (port-count-lines! in) (syntax->string (read-syntax "mystring" in)) ; -> "comment\n \"hello world\"\n line" On

Re: [racket-users] Is there a widget like QSplitter in Qt in our GUI library?

2021-03-31 Thread Laurent
You probably want panel:vertical-dragable% [1] and panel:horizontal-dragable%. See a usage example here: https://gist.github.com/Metaxal/946aa17033c10e76c48a74127ae0b11b [1]

Re: [racket-users] Word Count program/benchmark performance

2021-03-19 Thread Laurent
Sam: How do you accurately measure such small speed-ups? On my machines, if I run the same program twice, I can sometimes see more than 10% time difference. On Fri, Mar 19, 2021 at 4:10 PM Sam Tobin-Hochstadt wrote: > Use `#:authentic`, and `unsafe-vector*-{ref,set!}` saved about 50 more > ms

Re: [racket-users] Word Count program/benchmark performance

2021-03-19 Thread Laurent
(Welcome to Racket v8.0.0.1 [cs]. ) All results are measured on my laptop on the 10x file with `$ time racket `, thus including the Racket VM. * Bogdan's version with #lang racket/base: 1s. * Dominik's version with vectors of length 256 (instead of 26) and splitting on spaces/return/newline only

[racket-users] racket-launcher-names and easing the user experience

2021-03-01 Thread Laurent
Can I expect this to work trouble-free on Windows, Mac, Linux (at least debian/ubuntu) when installing a release the way a new user would do? If it requires any work by the user to make it work, it seems that asking to do $ racket -l- myprog is simpler. Thanks, Laurent -- You received this m

Re: [racket-users] dynamic-require

2021-02-03 Thread Laurent
You may be looking for `module->exports`: https://docs.racket-lang.org/reference/Module_Names_and_Loading.html?q=module-%3Eexports#%28def._%28%28quote._~23~25kernel%29._module-~3eexports%29%29 On Wed, Feb 3, 2021 at 3:31 AM jon stenerson wrote: > The previous message here prompts this ... > >

Re: [racket-users] Split-pane editing

2020-12-30 Thread Laurent
On Wed, Dec 30, 2020 at 11:38 AM John Kemp wrote: > I have recently been trying to do this too, as it looks like DrRacket > *should* allow this… > > On Dec 30, 2020, at 4:45 AM, Laurent wrote: > > in DrRacket you can hit View|Split, and you can split multiple times.

Re: [racket-users] Split-pane editing

2020-12-30 Thread Laurent
in DrRacket you can hit View|Split, and you can split multiple times. On Tue, Dec 29, 2020 at 10:53 PM Hendrik Boom wrote: > When editing code in emacs, I oftern split the pane so I have views on two > parts of a > file. > Typically, this is so I can see a function definition in one pane at the

Re: [racket-users] Is it possible to define a substruct with the same fields as its superstruct?

2020-12-10 Thread Laurent
or (struct fruit edible () #:transparent) On Thu, Dec 10, 2020 at 12:51 PM Noah Ma wrote: > (struct fruit () #:super struct:edible #:transparent) > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop

Re: [racket-users] simple question about call/cc

2020-12-08 Thread Laurent
Tim, if you paste your code in the definitions in DrRacket (with the #lang racket line), and run it (as a module, thus), you obtain this in the interactions window: 3 10 6 The `3` is because of the `(add1 (call/cc ... 2)))` expression, which is reduced to `(add1 2)` with the side effect of

Re: [racket-users] Re: Copy keybinding in DrRacket not working

2020-11-23 Thread Laurent
On Sun, Nov 22, 2020 at 7:45 PM Dimaugh Silvestris < dimaughsilvest...@gmail.com> wrote: > So I tried adding a custom keybinding using c:c, and now when I open > DrRacket, I get the error: > < /home/dimaugh/prog/rkt/keybindings.rkt: > map-function in keymap%: "c:c" is already mapped as a

Re: [racket-users] Help implementing an early return macro

2020-10-28 Thread Laurent
I've also had the same issues for a long time, and condd was almost good enough, but the #:do is too specific. But recently I'm using something much simpler (no continuation) and straightforward: cond/else https://github.com/Metaxal/bazaar/blob/master/cond-else.rkt By contrast to other

Re: [racket-users] [DrRacket] Is there a way to go to last edit location?

2020-10-12 Thread Laurent
I couldn't find an easy way to do this. (As a hack, I even tried undo+redo, but this also includes cursor movements apparently, so it doesn't help.) AFAICT, the undo history is buried under several private layers, so it's inaccessible from `send` (and thus currently not accessible from

Re: [racket-users] Re: Memory usage of (port->lines ...) is extreamly high

2020-09-24 Thread Laurent
Quick comment: of you don't need to load the whole file but want to parse it line by line, use `in-lines` which is memory-efficient. On Thu, Sep 24, 2020, 11:46 Hong Yang wrote: > Update with memory dump log attached. > > 1. With out (set! input empty), call (collect-garbage) doesn't help > 2.

Re: [racket-users] Is this running in DrRacket or as a script?

2020-09-02 Thread Laurent
option" and add "drracket". After this, when you run a module from within DrRacket, it will automatically run the `drracket` submodule, but this submodule will *not* be run from the command line (by default). (I also uncheck the "main" submodule as I use this one only for the co

Re: [racket-users] drracket -- getting the buffer's current filename?

2020-09-01 Thread Laurent
What do you want this for, more precisely? On Tue, Sep 1, 2020 at 3:35 PM ibar...@radford.edu wrote: > When running from inside drracket, `(find-system-path 'run-file)` > understandable returns the DrRacket executable. Is there a way for me to > further find the name of the source-file, in

Re: [racket-users] Re: Application Templates!

2020-08-20 Thread Laurent
My understanding is that Framework is born out of DrRacket, expecting that some of its tools may be useful in other contexts (like, say, keymaps). On Thu, Aug 20, 2020 at 3:11 PM Deren Dohoda wrote: > > I think Racket would benefit by a suite of applications which are small > but > > not

Re: [racket-users] Re: Application Templates!

2020-08-20 Thread Laurent
Stephen's work may still be quite useful, as it provides a set of really minimal (almost?) working examples that explain the specifics of various tools. I say keep it up, Stephen! On Thu, Aug 20, 2020 at 5:33 AM Alex Harsanyi wrote: > I am not sure that a template in the style of "dotnet new"

Re: [racket-users] Scribble and structs

2020-08-12 Thread Laurent
I have no idea about custom-write, but for the duplicate keys, maybe you installed the collection multiple times? Take a look at the output of `raco pkg show` maybe. On Wed, Aug 12, 2020 at 12:08 PM Deren Dohoda wrote: > Hi racketeers, > > I have two questions. The first is: is there a way to

Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-12 Thread Laurent
You can also cheat by writing the name with the same color as the background on the next lines (kind of like \vphantom in LaTeX). This has the advantage of aligning based on the length of each name instead of pushing everything to the right of the longest name, while working for any font. A

Re: [racket-users] Racket News - Issue 36

2020-08-04 Thread Laurent
Thanks Paulo, very interesting and useful as usual! This version of the featured paper "Hygienic macro expansion" is a little more readable: https://prl.ccs.neu.edu/img/kffd-tr-1986.pdf Or would Matthias be able to provide a freshly compiled version maybe? :) (I would be truly impressed if the

Re: [racket-users] ask the type of a value

2020-08-03 Thread Laurent
and yet: > (for-each (λ (x) (printf "~a: ~a\n" (~v x #:min-width 28) (struct->vector x))) `(hello "hello" 43110 #f #(h e l l o) #"hello" (h e l l o) ,(new frame% [label ""]))) hello : #(struct:symbol ...) "hello" : #(struct:string ...)

Re: [racket-users] ask the type of a value

2020-08-03 Thread Laurent
Maybe try `struct->vector`, which works on any value iirc (from mobile, can't test) On Mon, Aug 3, 2020, 15:19 Hendrik Boom wrote: > In plain, untyped Racket: > > It is possible to ask if a value is a symbol with symbol? > It is possible to ask if a value is a string with string? > etc. > > Is

Re: [racket-users] “If you could have a wish granted, what would you like to see next in Racket?”

2020-07-23 Thread Laurent
Just in case (not sure how relevant this is to you): https://docs.racket-lang.org/reference/Sandboxed_Evaluation.html?q=with-limits#%28form._%28%28lib._racket%2Fsandbox..rkt%29._with-limits%29%29 Works pretty well, but there are some caveats: if an object can be reached outside of the

Re: [racket-users] coding style query

2020-05-27 Thread Laurent
I use markdown syntax for that: The function `function` functions like `functions` but for a single function `proc`. I've seen others use `function' instead. On Wed, May 27, 2020 at 7:04 PM Jens Axel Søgaard wrote: > Den ons. 27. maj 2020 kl. 19.56 skrev Hendrik Boom >: > >> Is there an

Re: [racket-users] GUI executable creating an annoying command line window

2020-05-26 Thread Laurent
Does it change anything if you use #lang racket/gui instead of #lang racket (require racket/gui)? On Tue, May 26, 2020 at 10:00 AM Philip Benade wrote: > Hi All > > I have been trying to create a simple GUI with the racket/gui library. For > the most part it works but alongside my GUI it also

Re: [racket-users] Re: Strange behaviour of ptr-ref + ptr-add(?)

2020-05-10 Thread Laurent
ons in CS. > > I've pushed a repair. > > Thanks for the report, Laurent! > > At Sun, 10 May 2020 13:57:50 +0200, Jens Axel Søgaard wrote: > > I can confirm that the bug is present in the latest snapshot of Racket CS > > on macOS. > > > > FWIW _double* is

Re: [racket-users] Re: Strange behaviour of ptr-ref + ptr-add(?)

2020-05-10 Thread Laurent
e it whether it is > supposed to be handled here. > > https://github.com/racket/racket/blob/920c899ba866ce59a0387862286521e3cc1dabfb/racket/src/schemify/ptr-ref-set.rkt#L46 > > /Jens Axel > > Den søn. 10. maj 2020 kl. 10.51 skrev Laurent : > >> Correction: >> It's not Mac vs L

[racket-users] Re: Strange behaviour of ptr-ref + ptr-add(?)

2020-05-10 Thread Laurent
Correction: It's not Mac vs Linux, it's Racket BC (works) vs CS (doesn't work) On Sun, May 10, 2020 at 9:49 AM Laurent wrote: > Hi all, > > We're trying to figure out why the last case below doesn't work on > Linux, but works on MacOS. Does anyone have an explanation? > T

[racket-users] Strange behaviour of ptr-ref + ptr-add(?)

2020-05-10 Thread Laurent
Hi all, We're trying to figure out why the last case below doesn't work on Linux, but works on MacOS. Does anyone have an explanation? The docs suggest that _double* shouldn't be different from _double for _reading_ values. More precisely, #lang racket (require ffi/unsafe) (define N 10)

Re: [racket-users] Quickscript of the day: Extract to function

2020-05-10 Thread Laurent
Stephen De Gabrielle < spdegabrie...@gmail.com> wrote: > Awesome - keep them coming. > > You should feature one in each Racket-News! > > Stephen > > On Thu, 7 May 2020 at 10:33, Laurent wrote: > >> Have you ever wanted to extract a block of code out of its contex

Re: [racket-users] A convenient assertion macro - with one caveat

2020-05-07 Thread Laurent
Check out `make-check-location` and friends, and maybe `with-check-info*` https://docs.racket-lang.org/rackunit/api.html?q=define-check#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-check-location%29%29 You may have to combine with the syntax-information extracted from the syntax object `stx`.

[racket-users] Quickscript of the day: Extract to function

2020-05-07 Thread Laurent
Have you ever wanted to extract a block of code out of its context and wrap it in a function? Have you ever *not* done it because of the cognitive load(*) of figuring out the function arguments and the return values? Well, now it's as easy as Ctrl-Shift-X and Ctrl-Shift-Y. Using check-syntax,

Re: [racket-users] Matching groups of optional elements

2020-05-05 Thread Laurent
If you insist on using match, you can do it with a loop: #lang racket (define (parsel l) (match l [(list-rest req1 req2 r) (cons (list req1 req2) (let loop ([r r]) (match r ['() '()] [(list-rest opt1 opt2 opt3 opt4 r2)

Re: [racket-users] Should I stop sending packages to the catalog?

2020-05-01 Thread Laurent
For your second point, you can never really know what other work depends on your package. You could display a message in the new package or in the readme for example, but that's likely not going to work well for various reasons. (but see my last comment) However, what Jay is saying I believe

Re: [racket-users] Rhombus project plan

2020-04-30 Thread Laurent
Also, if I remember correctly, the timings given in the said (excellent) tutorial are very conservative or outdated. If you have a multicore machine, it will speed up the process by up to a factor 8. On Thu, Apr 30, 2020, 15:42 Sam Tobin-Hochstadt wrote: > On Thu, Apr 30, 2020 at 9:09 AM Ben

Re: [racket-users] Re: Should I stop sending packages to the catalog?

2020-04-30 Thread Laurent
Alex, that looks like an interesting workflow. Maybe worth a blog post? ;) On Thu, Apr 30, 2020 at 12:11 AM Alex Harsanyi wrote: > > You could both send packages to the package catalog and instruct your > users to use a different package source if they wish to use old versions. > I don't see

Re: [racket-users] Reflecting on context arity

2020-03-28 Thread Laurent
Follow up on Ben's idea: Take n as an optional argument, init value #f. On first application of f on the first values, continue n-map with n=received number of values. Once arrived at the empty lists you know how many values you should have. At each iteration, you can even check that the number of

Re: [racket-users] Limiting consecutive identical elements with match

2019-12-04 Thread Laurent
I don't know what the exact specs are, but what should be the return values for '(a a a b b c) and '(a a b b b c) ? (I can't test right now but I suspect the match approach might miss one) On Wed, Dec 4, 2019, 23:56 Matthew Butterick wrote: > > On Dec 4, 2019, at 3:26 PM, 'Joel Dueck' via

Re: [racket-users] Re: GUI (get-directory)

2019-11-23 Thread Laurent
There may be some examples on Rosetta code, or at least Racket snippets could be added: https://rosettacode.org/wiki/Category:GUI On Sat, Nov 23, 2019, 00:23 Martin DeMello wrote: > One helpful thing to do is expand the GUI section of awesome-racket > https://github.com/avelino/awesome-racket >

Re: [racket-users] Determining if 2 lists share a common element

2019-11-14 Thread Laurent
On Thu, Nov 14, 2019 at 3:11 AM Andrew wrote: > I have this: > > (define (related? a1 a2) > (if (equal? a1 a2) > true > (related? (member (rest ("proc that calls list" a1)) (rest ("proc > that calls list" a2))) > (member a1 ("proc that calls list" a2)) > I can't make

Re: [racket-users] horizontal alignment in a message% or equivalent

2019-10-13 Thread Laurent
If I remember correctly, I think you want to add a spacer box at the right of your message% in the same panel: https://docs.racket-lang.org/gui/grow-box-spacer-pane_.html?q=message%25 so that the message takes only the space it needs and is thus flushed to the left. On Sun, Oct 13, 2019 at 8:11

Re: [racket-users] continuations for search

2019-09-12 Thread Laurent
Hendrik, There is also the all too often forgotten iterative deepening depth-first search algorithm: https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search which has the advantages of both, at a very small cost in search time compared to doing depth-first search with the right

Re: [racket-users] [OT] Cities and GPS

2019-09-08 Thread Laurent
This DB is even better: http://download.geonames.org/export/ On Sun, Sep 8, 2019 at 8:34 AM Laurent wrote: > Nice :) > > > On Sat, Sep 7, 2019 at 2:00 AM Alex Harsanyi > wrote: > >> In fact, I updated the data frame package to be able to read the CSV file >

Re: [racket-users] [OT] Cities and GPS

2019-09-08 Thread Laurent
uot; "lng" "population")]) >> (->numeric df series)) >> >> (define ((is-city? name) v) >> (equal? (vector-ref v 0) name)) >> >> (df-select* df "city" "country" "lat" "lng" #:filter (is-city? &

Re: [racket-users] [OT] Cities and GPS

2019-09-06 Thread Laurent
There's a small free database here too: https://simplemaps.com/data/world-cities I started writing a simple query system for it this morning (csv->rktd, then just list of assoc operations). On Fri, Sep 6, 2019 at 1:35 PM Sage Gerard wrote: > Would geonames help? > http://www.geonames.org/ > >

Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Laurent
Adam, I strongly recommend you take a look at Levin Search (aka Universal Search), which enumerates and runs programs by dovetailing in a smart way: http://people.idsia.ch/~juergen/mljssalevin/node4.html http://www.scholarpedia.org/article/Universal_search#Universal_search This avoids the

Re: [racket-users] Listing All Programs

2019-09-05 Thread Laurent
however.) At least it's very simple to generate all 'syntactically' valid Turing machines ;) On Thu, Sep 5, 2019 at 2:56 PM David Van Horn wrote: > But whether a program is syntactically valid is not an easy thing to > decide in a language like racket... > > On Thu, Sep 5, 2019, 9:4

Re: [racket-users] Pict combiners in list form?

2019-09-05 Thread Laurent
Or as a simple hack you can redefine `apply' as a one letter binding like `~'. On Thu, Sep 5, 2019 at 12:52 PM Robby Findler wrote: > Although this is a bit tedious and I write that too much too ... maybe > they should call "flatten" on their arguments or just accept a list of > picts? > >

Re: [racket-users] Listing All Programs

2019-09-05 Thread Laurent
Probably only those that output Chaitin's constant ;) But otherwise I would guess "syntactically valid", in which case it would be easier to consider only lambdas with only one argument. Though if you want to also use all of Racket's primitives (that is, including I/O), then good luck. My

Re: [racket-users] images in racket files

2019-07-19 Thread Laurent
Looks like your best bet is to save the pict as a bitmap in a separate file, then load it in your module and export this value. >From the top of my head: where the pic is produced: (send (pict->bitmap my-pict) save-bitmap "path-to/the-bitmap-file.png" 'png) (or maybe: right click on the snip then

Re: [racket-users] Re: Impromptu racket meetup in London Friday, 19 July at 12pm-3pm

2019-07-16 Thread Laurent
Good idea. I might come between 12pm and 1pm. On Fri, Jul 12, 2019 at 8:36 PM zeRusski wrote: > argh, wish you'd go with after work hours or the weekend. Sorry, won't be > able to make it. > > On Friday, 12 July 2019 09:20:58 UTC-6, Stephen De Gabrielle wrote: >> >> Hi, >> >> Next Friday, 19

Re: [racket-users] returning GUI elements in function?

2019-07-09 Thread Laurent
There are several ways to solve this (including deriving classes), but the simplest for you right now is probably to have `initialize-progress-bar' return the gui widgets (in particular `gauge' and `msg'), assign the values to `the-gauge' and `the-msg' (say) from the return values of

Re: [racket-users] anyone using single-flonums?

2019-05-30 Thread Laurent
If no one is really relying on them as of today, then I would strongly support allowing Matthew to break things and move fast. If anyone has a real need for such a data structure it can still probably be implemented later as a third-party library, possibly extended to user-specified-precision

Re: [racket-users] Racket v7.3

2019-05-16 Thread Laurent
Thank you all for the new release! On Wed, May 15, 2019 at 7:05 PM 'John Clements' via Racket Users < racket-users@googlegroups.com> wrote: > - Racket's IO system has been refactored to improve performance > and simplify internal design. > Is it mild overall performance improvement, or are

Re: [racket-users] Re: Online IDE’s for Racket ?

2019-05-01 Thread Laurent
Rollapp looks interesting, but when I want to sign in with my gmail account it requires to get information about all my linked email addresses. That really seems unnecessary to me, so I didn't try it. On Fri, Apr 26, 2019 at 9:59 PM Stephen De Gabrielle < spdegabrie...@gmail.com> wrote: > Yes -

Re: [racket-users] finding the package that a function is defined in

2019-04-28 Thread Laurent
For DrRacket there's a quickscript in the quickscript-extra package, called "provided-by" (not sure which of "by" or "from" is the appropriate English form here...). It searches all(?) installed libraries for you and reports the packages that export the identifier under the keyboard cursor.

Re: [racket-users] color-maps for the plot package

2019-03-20 Thread Laurent
This is a fantastic idea, Alex. (While I'm at it, thanks for all your other projects related to the GUI, they are really cool.) I'm *very* much in favour of all your points, (1) to (4). I've had uses of different colors scheme for academic papers, and the default palette doesn't work well for

Re: [racket-users] printing decimals

2019-03-15 Thread Laurent
You're probably looking for `real->decimal-string`. Also take a look at ~r instead of ~a, as the former is only for numbers. On Fri, Mar 15, 2019 at 5:57 PM wrote: > Hi all, > > I've been looking through the docs for a way to print decimals to a > defined precision. > > I can get close to what

Re: [racket-users] Pretty display of tabular data?

2019-03-13 Thread Laurent
Not sure how much this would help you, but there's a `text-table`package. It's fairly simple though. Docs: https://docs.racket-lang.org/text-table/index.html On Wed, Mar 13, 2019 at 6:19 PM Matt Jadud wrote: > Hi all, > > I have a tabular data type that I'd like (I think) to be able to render

Re: [racket-users] tree-layout, many many thanks

2019-02-27 Thread Laurent
A long time ago I had a need for this too, so I just made one for me: https://github.com/Metaxal/bazaar/blob/master/slideshow/slideshow-tree.rkt The behaviour is a bit different from pict/tree-layout. There's an example usage in the drracket submodule at the end of the file that produces: [image:

Re: [racket-users] Cannot use case+else inside match+else

2019-02-27 Thread Laurent
Good point. I wasn't sure that would work---it does. On Wed, Feb 27, 2019 at 1:28 PM Jens Axel Søgaard wrote: > I suppose you could (re)require it again. > > ons. 27. feb. 2019 kl. 14.19 skrev Laurent : > >> Wait, that means that in an interactive session, if you ever hap

Re: [racket-users] Cannot use case+else inside match+else

2019-02-27 Thread Laurent
Wait, that means that in an interactive session, if you ever happen to redefine `else', you can't use `case' anymore? On Tue, Feb 26, 2019 at 5:03 AM Ben Greenman wrote: > Here's a suggestion for the docs: > > https://github.com/racket/racket/pull/2505 > > -- > You received this message because

Re: [racket-users] Strange behavior from regexp-match*

2019-02-10 Thread Laurent
Not sure what the actual problem is, but may be this excerpt from the docs is relevant: The internal size of a regexp value is limited to 32 kilobytes; this limit roughly corresponds to a source string with 32,000 literal characters or 5,000 operators. Source:

Re: [racket-users] Re: nested for loops and suggested alternatives

2019-02-10 Thread Laurent
perhaps more importantly: -- (build-vector 5 (lambda (_) (make-vector 5 0))) -- (make-vector 5 (build-vector 5 (lambda (_) 0))) On Sun, Feb 10, 2019 at 3:16 PM Gustavo Massaccesi wrote: > To understand the problem, it will be useful to understand the difference > between > > -- (make-vector 5

Re: [racket-users] Re: read-from-string(-all)

2019-02-07 Thread Laurent
; > '(123 456) > > > > although I am not sure it is a good idea to call read on strings > received from the user... > > > > Alex. > > On Wednesday, February 6, 2019 at 6:49:57 PM UTC+8, Laurent Orseau wrote: > >> > >> read-from-string and read-from-str

Re: [racket-users] Re: read-from-string(-all)

2019-02-06 Thread Laurent
Oh nice, I didn't know we could do that one! Point taken :) I suppose (hope?) you can still use sandboxing with memory limits for this? On Wed, Feb 6, 2019 at 11:52 AM Alex Harsanyi wrote: > > > On Wednesday, February 6, 2019 at 7:36:40 PM UTC+8, Laurent Orseau wrote: >> >>

Re: [racket-users] Re: read-from-string(-all)

2019-02-06 Thread Laurent
On Wed, Feb 6, 2019 at 11:25 AM Alex Harsanyi wrote: > (read-from-string "123") is equivalent to `(call-with-input-string "123" > read)` while read-from-string-all can be replaced by: > > (define (read-all in) > (let loop ([result '()]) > (let ((v (read in))) > (if

[racket-users] read-from-string(-all)

2019-02-06 Thread Laurent
read-from-string and read-from-string-all are convenient functions, but they belong to the mzlib/string library, which is deprecated. I can't find an existing replacement in racket/string or racket/base. Is there one with a different name? -- You received this message because you are subscribed

Re: [racket-users] Quickscript error on first startup of Racket 7.2

2019-02-04 Thread Laurent
On Mon, Feb 4, 2019 at 9:55 PM Robby Findler wrote: > > Possibly. I'm not sure what would be the best option yet, I'll think > about it but I welcome suggestions. > > I think the main thing should be to avoid any uncaught exceptions (if > they happen while quickscript starts up, it will get

Re: [racket-users] Quickscript error on first startup of Racket 7.2

2019-02-04 Thread Laurent
On Sun, Feb 3, 2019 at 7:00 PM Robby Findler wrote: > > > On Sun, Feb 3, 2019 at 11:50 AM Laurent wrote: > >> I've pushed a repair. It should be integrated with the next racket >> nightly release I suppose. >> >> The fix is to check the compiled v

Re: [racket-users] Quickscript error on first startup of Racket 7.2

2019-02-03 Thread Laurent
file"). Have you done something like this before? On Fri, Feb 1, 2019 at 1:37 PM Laurent wrote: > Okay then, I'll work on a fix tomorrow. > > On Fri, Feb 1, 2019 at 1:23 PM Robby Findler > wrote: > >> I can't say concretely what will go wrong I am sorry to say. There are &

[racket-users] Re: From Guido to Matthias (was: Python's append vs Racket's append and helping novices understand the implications)

2019-02-03 Thread Laurent
Ouch!! :-D On Sun, Feb 3, 2019 at 3:40 PM Matthias Felleisen wrote: > > > On Feb 3, 2019, at 10:12 AM, Laurent wrote: > > When was that and what was the outcome of this meeting? > > > > Nothing. It was a waste of my time. — Matthias > > -- You received this m

[racket-users] From Guido to Matthias (was: Python's append vs Racket's append and helping novices understand the implications)

2019-02-03 Thread Laurent
Now you just peaked my curiosity! When was that and what was the outcome of this meeting? On Sat, Feb 2, 2019 at 11:00 PM Matthias Felleisen wrote: > > [[ p.s. For my very first Python program (a couple of days before meeting > with GvR), I used Python’s append and was annoyed beyond belief.

Re: [racket-users] drracket migrate: package is currently installed in a wider scope

2019-02-01 Thread Laurent
Thanks for the fast fix Matthew! It should help at least for those who install the nightlies but haven't upgraded yet. On Fri, Feb 1, 2019 at 4:46 PM Matthew Flatt wrote: > At Fri, 1 Feb 2019 15:45:02 +0000, Laurent wrote: > > Okay, I think the problem is that DrRacket's dependency

Re: [racket-users] ~v in drracket vs commandline

2019-02-01 Thread Laurent
But I should add that that's not a big deal to me now, since at least now I know how to work around it. On Fri, Feb 1, 2019 at 4:06 PM Laurent wrote: > Or better yet, maybe replace the choice between print and write to a > boolean choice on the initial value of 'print-as-expr

Re: [racket-users] ~v in drracket vs commandline

2019-02-01 Thread Laurent
: > Could it be changed to also set `(print-as-expression)` appropriately? > > Sam > > On Fri, Feb 1, 2019 at 11:02 AM Robby Findler > wrote: > > > > Ah, right! I forgot about that setting. Yes, what you describe is > > exactly what happens. > > > > Robb

Re: [racket-users] ~v in drracket vs commandline

2019-02-01 Thread Laurent
and command line. On Fri, Feb 1, 2019 at 3:48 PM Laurent wrote: > I'm in #lang racket for DrRacket, and I assume it's the same for the > command line when merely starting "$ racket" > > > On Fri, Feb 1, 2019 at 3:39 PM Robby Findler > wrote: > >> This

Re: [racket-users] ~v in drracket vs commandline

2019-02-01 Thread Laurent
acket or the one you are > "inside" in the repl if you're in one). Possibly those are different > for you, Laurent? > > Robby > > On Fri, Feb 1, 2019 at 9:33 AM Sam Tobin-Hochstadt > wrote: > > > > I see the same behavior in DrRacket as in command l

Re: [racket-users] drracket migrate: package is currently installed in a wider scope

2019-02-01 Thread Laurent
to remove quickscript-extra, if you've installed it, since it is not in DrRacket's dependencies.) Glad you like it in any case :) On Fri, Feb 1, 2019 at 2:47 PM andrew blinn wrote: > Hi Laurent! > > I may be misattributing the error. I did indeed already have quickscript > insta

[racket-users] ~v in drracket vs commandline

2019-02-01 Thread Laurent
I'm seeing a difference that I can't explain. In the interactions below, look for the leading quote in the output string on the commandline, and its absence in DrRacket. The same problem happens when running a module containing the same code, so it's not a top-level issue. Is there another

Re: [racket-users] Quickscript error on first startup of Racket 7.2

2019-02-01 Thread Laurent
r it! We have a fallback if this don't work out. :) > > Robby > > On Fri, Feb 1, 2019 at 7:01 AM Laurent wrote: > >> On Fri, Feb 1, 2019 at 11:30 AM Robby Findler < >> ro...@eecs.northwestern.edu> wrote: >> >>> My feeling is that our compil

Re: [racket-users] Quickscript error on first startup of Racket 7.2

2019-02-01 Thread Laurent
y anyway, just requiring a little more time. Copying the same scripts in different folders will very likely mean divergence of source at some point and likely frustration for the user. Or am I missing something? > > Robby > > On Fri, Feb 1, 2019 at 4:12 AM Laurent wrote: > >&

Re: [racket-users] drracket migrate: package is currently installed in a wider scope

2019-02-01 Thread Laurent
Hi Andrew, I don't quite understand what role quickscript being part of the main distribution plays here. Can you give some more details about your issue? Just in case, the only change is that quickscript is by default a dependency of DrRacket, which just means that if you didn't have it before,

Re: [racket-users] Quickscript error on first startup of Racket 7.2

2019-02-01 Thread Laurent
Thanks for bringing this up. Indeed the compile option from the quickscript menu should work, but it's not ideal. I'm not a big fan of the copy option. (To me that sounds like asking for trouble, but I may be wrong.) A nicer solution may be to simply check if the scripts are compiled with the

  1   2   >