Re: [racket-users] in-directory sorted results

2020-08-03 Thread evdubs
Sorry, I cherry-picked the doc example as an "easy" example that others might be able to easily observe. However, please imagine the following filesystem: /var/tmp/test/1.txt /var/tmp/test/2.txt /var/tmp/test/3.txt /var/tmp/test/4.txt The following shows these files in order: > (for/list ([f

[racket-users] ask the type of a value

2020-08-03 Thread Hendrik Boom
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 there a way to ask the type of a value without having to guess it first? -- hendrik -- You received this message because you are subscribed to

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

2020-08-03 Thread Ryan Culpepper
but beware, for > (for-each (lambda (x) (printf "~a: ~a\n" (~v x #:min-width 28) (struct->vector x))) (list "hello" (let () (struct string (n)) (string 5 "hello" : #(struct:string ...) # : #(struct:string ...) Ryan On Mon, Aug 3, 2020

[racket-users] Re: Racket v7.8

2020-08-03 Thread 'John Clements' via Racket Users
This release announcement mistakenly omitted two important contributors: Tim Brown, and Dionna Amalie Glaze. Many thanks for their help! John Clements > On Aug 3, 2020, at 09:35, John Clements wrote: > > Racket version 7.8 is now available from > >https://racket-lang.org/ > > > *

Re: [racket-users] ask the type of a value (partial solution)

2020-08-03 Thread Hendrik Boom
On Mon, Aug 03, 2020 at 05:06:51PM +0100, Laurent wrote: > 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 :

Re: [racket-users] Advice wanted about new opengl binding

2020-08-03 Thread Philip McGrath
Is this what you're looking for? https://pkgs.racket-lang.org/package/sgl -Philip On Sun, Aug 2, 2020 at 5:51 PM Hendrik Boom wrote: > Time to rethink everything before I go further. > > So far I've found several opengl bindings. > There's opengl, documented here: >

Re: [racket-users] pictures in code?

2020-08-03 Thread Philip McGrath
On Mon, Aug 3, 2020 at 9:47 AM Hendrik Boom wrote: > On Sun, Aug 02, 2020 at 08:58:54PM -0700, Sorawee Porncharoenwase wrote: > > For DrRacket, it's possible via "Insert > Insert Image". It's been used > in > > HtDP. See https://htdp.org/2020-8-1/Book/part_prologue.html > > Now that's presumably

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] ask the type of a value

2020-08-03 Thread Alexis King
In general, the answer is “no,” mostly because it’s not clear in Racket what “the type of a value” means. It’s difficult to come up with a definition that would be useful enough to satisfy your criterion of not “having to guess it first.” Consider: suppose you had a hypothetical `type-of`

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] in-directory sorted results

2020-08-03 Thread Matthew Flatt
At Sun, 2 Aug 2020 18:38:18 -0700 (PDT), evdubs wrote: > However, the docs also show: > > > (current-directory (collection-path "info")) > > (for/list ([f (in-directory)]) > f) > '(# > # > # > #) > > Isn't this not getting sorted correctly? I am seeing that calls to > (in-directory)

[racket-users] Racket v7.8

2020-08-03 Thread 'John Clements' via Racket Users
Racket version 7.8 is now available from https://racket-lang.org/ * Racket CS may become the default Racket implementation in the next release. With the improvements in this release, Racket CS provides all of the functionality of Racket BC (the current default implementation). If,

Re: [racket-users] pictures in code?

2020-08-03 Thread Hendrik Boom
On Sun, Aug 02, 2020 at 08:58:54PM -0700, Sorawee Porncharoenwase wrote: > For DrRacket, it's possible via "Insert > Insert Image". It's been used in > HtDP. See https://htdp.org/2020-8-1/Book/part_prologue.html Yes! That's where I saw this many years ago. Now that's presumably something that

[racket-users] Announce: Clotho 1.0.0 Released

2020-08-03 Thread Eric Eide
I am pleased to announce that Clotho version 1.0.0 is available. You can find it in the Racket package catalog at: https://pkgs.racket-lang.org/package/clotho Clotho provides controllable randomness functions for Racket programs, allowing sequences of random values to be recorded, replayed,

Re: [racket-users] ask the type of a value (partial solution)

2020-08-03 Thread Alexis King
> On Aug 3, 2020, at 11:48, Hendrik Boom wrote: > > Still, it would be nice to find out how to get this information more > directly instead of relying on functions that do much more than > what I was asking for. In general, there aren’t any. The ability of struct->vector to extract a

Re: [racket-users] Advice wanted about new opengl binding

2020-08-03 Thread Hendrik Boom
On Mon, Aug 03, 2020 at 02:01:16PM -0400, Philip McGrath wrote: > Is this what you're looking for? https://pkgs.racket-lang.org/package/sgl > > -Philip Yes, looks like it. Is it messing from the index for some good reason? I'm not sure how the packaging works. I end up at