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 https://github.com/racket/sgl/tree/master
where I find multiple files, including main.rkt, sgl.rlt, and gl.rkt.
Am I correct that main.rkt is what I get with (require sgl)
and that gl.rkt is what I get with (require sgl/gl)?

-- hendrik

> 
> 
> 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:
> >https://docs.racket-lang.org/opengl/index.html
> > There are sgl and sgl/gl, documented here:
> >https://docs.racket-lang.org/sgl/index.html
> > and there's a typed opengl hidden with in pict3.
> >
> > But I cannot find sgl and sgl/gl in the index of packages
> > at https://pkgs.racket-lang.org/
> >
> > Shouldn't they be there?
> > Are they there in disguise?
> > Abd where should I look for current source code?
> > The index is pretty good at identifying source code for other packages.
> >
> > -- hendrik
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/20200802215123.iiqik4wpfusarcw4%40topoi.pooq.com
> > .
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAH3z3gYmn4_5sTUNWuZDcpjL5shJmU2quTtgx72%3DoycOXccp5A%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200803232728.e4yv7khscvr7c2wl%40topoi.pooq.com.


[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, and manipulated at a fine
grain.

You can learn more about Clotho by reading the online documentation:

  https://docs.racket-lang.org/clotho/index.html

...and by reading the following paper, which will be presented at the upcoming
Scheme '20 workshop:

  Pierce Darragh, William Gallard Hatch, and Eric Eide.  Clotho: A Racket
  library for parametric randomness.  In Proceedings of the 2020 Scheme and
  Functional Programming Workshop (Scheme 2020), August 2020.
  https://www.flux.utah.edu/paper/darragh-scheme20

Thanks ---

Eric.

-- 
---
Eric Eide   . University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/m1k0yf1n92.fsf%40cs.utah.edu.


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 
symbolic name for any value really is specific to struct->vector (and it’s only 
really useful for debugging, for the reason Ryan points out).

If you only care about bona fide structs, not primitive values like strings and 
ports, you can do a little better using struct-info:

(define (type-name v)
  (match/values (struct-info v)
[(#f _) #f]
[((app struct-type-info name _ _ _ _ _ _ _) _) name]))

(struct point (x y) #:transparent)
(type-name (point 1 2)) ; => 'point

But this doesn’t work for non-transparent structs unless you own a sufficiently 
powerful inspector:

(let ()
  (struct point (x y))
  (type-name (point 1 2))) ; => #f

(let ()
  (struct point (x y)
#:inspector (make-inspector))
  (type-name (point 1 2))) ; => 'point

But again, this just gets you a symbolic name, which is subject to the same 
issue Ryan points out. The value you get back from struct-info is truly unique 
to that particular type, so it’s a more useful value than the symbolic name. 
But again, it’s not clear to me why you’d want to do this (except for 
debugging/instrumentation), since you still can’t possibly do anything useful 
with a value of a truly unknown type.

On the other hand, if it *is* for debugging, then meddling with the inspector 
is a valid thing to do (and is in fact one of the main reasons inspectors 
exist). You can change current-inspector to a weaker inspector during the 
instantiation of the modules you want to debug, and then you can use 
struct-info to get information about any values of the struct types they create.

Alexis

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5CAB018A-6F47-4FBA-A249-6A7472D8A896%40gmail.com.


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:
>https://docs.racket-lang.org/opengl/index.html
> There are sgl and sgl/gl, documented here:
>https://docs.racket-lang.org/sgl/index.html
> and there's a typed opengl hidden with in pict3.
>
> But I cannot find sgl and sgl/gl in the index of packages
> at https://pkgs.racket-lang.org/
>
> Shouldn't they be there?
> Are they there in disguise?
> Abd where should I look for current source code?
> The index is pretty good at identifying source code for other packages.
>
> -- hendrik
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/20200802215123.iiqik4wpfusarcw4%40topoi.pooq.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAH3z3gYmn4_5sTUNWuZDcpjL5shJmU2quTtgx72%3DoycOXccp5A%40mail.gmail.com.


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 something that works nicely in the DrRacket editor.
> When DrRacket saves it into a file, it presumably uses some notation that
> won't look like a picture in, say, emacs.
>

Yes, that's all correct. My knowledge isn't very deep here, but to answer
the questions you asked:


> But will it still be recognised as an image if I use Racket to run that
> file?
>

Yes. The only difference is that the default printer (for example) doesn't
know how to print pictures, so you will see some output like:
philip$ racket image-literal.rkt
(object:image% ... ...)
when DrRacket would actually print the image. In principle, this is just
like DrRacket's ability to print `1/3` using barred decimal notation.

Can the image be used as a symbol or a constant or is it some other type
> of object?
>

The idea, as I understand it, is that an image is a self-quoting literal
datum like `42`, `"foo`", `#false`, or `#px"\\d+"`.

What kind of a datum is it? Alexis has explained in your other thread why
that's a difficult question.

Practically, I know that image literals answer `#true` to `image?` from the
`2htdp/image `
library. That's the only way I can remember having worked with them, but I
know they are also some other kinds of things: for example, an image
literal is an instance of (a subclass of) `snip%
` from `racket/gui`.

How is this implemented? My vague understanding is that there's some deep
magic baked into `racket/gui` to support image literals, I think around
`mrlib/image-core` and `mrlib/image-core-wxme`. I know there are some
limitations to this approach (though I don't immediately remember what all
of them are), and there have been some discussions about more general
mechanism for languages to support new kinds of literal data. The most
in-depth work I know of is from Lief's `#lang video `,
where she's experimenting with non-linear video editor literals

.

 Hope this helps.

-Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAH3z3gYs1L8Zgiapino%3DRVj3%3DX%3DmYm%3DJ_4c50KMDjESmrYC%2Brg%40mail.gmail.com.


[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/
> 
> 
> * 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, between this release and the next, no bugs are
>  discovered in Racket CS that are more serious than those typically
>  discovered in Racket BC, then Racket CS will become the default for
>  the next release.
> 
> * Racket CS supports AArch32 and AArch64, including places and
>  futures. The implementation should be considered experimental in this
>  initial release.
> 
> * Racket CS supports an "incremental" garbage-collection mode that can
>  eliminate long GC pauses for some applications, such as animations and
>  interactive games.
> 
> * Racket CS unboxes local floating-point arithmetic (like Racket BC).
> 
> * DrRacket's spell check features lower overhead and has fewer bugs.
> 
> * Web Server performance under high concurrency is [better by up to an
>  order of magnitude](https://github.com/racket/web-server/pull/94/).
>  The Web Server is also more resistant to clients attempting to use
>  unconstrained resources.
> 
> * The math library includes the Kronecker product.
> 
> * Windows supports finer granularity for `sleep` when sleeping for short
>  periods of time, improving performance in animation.
> 
> * The new prop:struct-field-info property provides static information
>  about field names.
> 
> * Debugging context in Racket CS is limited to 64,000 frames
>  (approximately the same as Racket BC). This reduces the time taken to
>  handle out-of-memory failures.
> 
> * In `plot`, the legend font and the plot font can be controlled
>  independently, and error-bars have an `#:invert?` option.
> 
> * The plot and math libraries have new maintainers: Alex Harsányi for
>  plot and Pavel Pancheka and Jens Axel Søgaard for math.
> 
> 
> The following people contributed to this release:
> 
> Alex Harsányi, Alex Knauth, Alexander Shopov, Alexis King, Andrew Kent,
> Andrew Mauer-Oats, Atharva Raykar, Ben Greenman, Benjamin Yeung, Bert De
> Ketelaere, Bogdan Popa, David Christiansen, David Florness, Diego
> Crespo, Fred Fu, Gary Baumgartner, Georges Dupéron, Gustavo Massaccesi,
> J. Ian Johnson, Jack Firth, Jay McCarthy, Jens Axel Søgaard, Jesse
> Alama, John Clements, Laurent Orseau, Leif Andersen, Luka Hadži-Đokić,
> Marc, Matthew Butterick, Matthew Flatt, Matthew Parris, Matthew Turland,
> Matthias Felleisen, Michael Ballantyne, Mike Sperber, Noah W M, Paulo
> Matos, Pavel Panchekha, Philip McGrath, Raphael Das Gupta, Reuben
> Thomas, Ricardo Herdt, Robby Findler, Ryan Culpepper, Sam
> Tobin-Hochstadt, Sancho McCann, Sorawee Porncharoenwase, Spencer
> Florence, Stephen De Gabrielle, Syntacticlosure, frogbird, kryptine,
> rsiddharth, and yurkobb
> 
> Feedback Welcome
> 



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/67a075d1-a160-4fe1-a11f-137f06277127%40mtasv.net.


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 at 6:07 PM 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   : #(struct:symbol ...)
> "hello" : #(struct:string ...)
> 43110   : #(struct:fixnum-integer ...)
> #f  : #(struct:false ...)
> #(h e l l o): #(struct:vector ...)
> #"hello": #(struct:byte-string ...)
> (h e l l o) : #(struct:pair ...)
> #(struct:object:frame% ...) : #(struct:object:frame% ...)
>
> ;)
>
>
> On Mon, Aug 3, 2020 at 4:20 PM Alexis King  wrote:
>
>> 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` operation that returned a value’s type:
>>
>> (type-of 'hello) ; => 'symbol
>> (type-of "hello") ; => 'string
>>
>> Now suppose you apply type-of to a value you know nothing about and get
>> back 'widget. Well, you don’t know what a widget is, so that didn’t
>> actually get you any further from where you started: you still don’t know
>> what to do with the value.
>>
>> Furthermore, types are not actually disjoint. You can write a struct
>> definition with properties like prop:procedure and prop:evt, and if a
>> struct has both, should type-of return the struct’s name, 'procedure, or
>> 'evt? It’s not really clear. You might be able to come up with some more
>> sophisticated system with (potentially multiple) inheritance that could
>> capture these relationships, but I can say with confidence that no such
>> system currently exists in Racket.
>>
>> Alexis
>>
>> > On Aug 3, 2020, at 09: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 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 the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/C561F2A9-0C78-4EDA-A401-4FB067D79849%40gmail.com
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CABNTSaGUiZWoU9mZbqMjB04FSu_kFOGrgyv0riU8TuKtffB_dg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CANy33qnV3CNH3eGpVZ59qx%2BZQfjmaJ%3D9gSBfk_TY6aSx5F4k1w%40mail.gmail.com.


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   : #(struct:symbol ...)
> "hello" : #(struct:string ...)
> 43110   : #(struct:fixnum-integer ...)
> #f  : #(struct:false ...)
> #(h e l l o): #(struct:vector ...)
> #"hello": #(struct:byte-string ...)
> (h e l l o) : #(struct:pair ...)
> #(struct:object:frame% ...) : #(struct:object:frame% ...)
> 
> ;)

Thank you.

That itself is already useful.
struct->vector combined with printf handles my immediate application.
It told me #(struct:object:image-snip% ...)
As I've been warned, it doesn't tell me much, but the result is a 
useful clue for further investigation.

It turns out to react positively to image?

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.

-- hendrik

> 
> 
> On Mon, Aug 3, 2020 at 4:20 PM Alexis King  wrote:
> 
> > 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` operation that returned a value’s type:
> >
> > (type-of 'hello) ; => 'symbol
> > (type-of "hello") ; => 'string
> >
> > Now suppose you apply type-of to a value you know nothing about and get
> > back 'widget. Well, you don’t know what a widget is, so that didn’t
> > actually get you any further from where you started: you still don’t know
> > what to do with the value.
> >
> > Furthermore, types are not actually disjoint. You can write a struct
> > definition with properties like prop:procedure and prop:evt, and if a
> > struct has both, should type-of return the struct’s name, 'procedure, or
> > 'evt? It’s not really clear. You might be able to come up with some more
> > sophisticated system with (potentially multiple) inheritance that could
> > capture these relationships, but I can say with confidence that no such
> > system currently exists in Racket.
> >
> > Alexis
> >
> > > On Aug 3, 2020, at 09: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 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 the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/C561F2A9-0C78-4EDA-A401-4FB067D79849%40gmail.com
> > .
> >

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200803164843.if7wggbketi2ziyl%40topoi.pooq.com.


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 ...)
43110   : #(struct:fixnum-integer ...)
#f  : #(struct:false ...)
#(h e l l o): #(struct:vector ...)
#"hello": #(struct:byte-string ...)
(h e l l o) : #(struct:pair ...)
#(struct:object:frame% ...) : #(struct:object:frame% ...)

;)


On Mon, Aug 3, 2020 at 4:20 PM Alexis King  wrote:

> 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` operation that returned a value’s type:
>
> (type-of 'hello) ; => 'symbol
> (type-of "hello") ; => 'string
>
> Now suppose you apply type-of to a value you know nothing about and get
> back 'widget. Well, you don’t know what a widget is, so that didn’t
> actually get you any further from where you started: you still don’t know
> what to do with the value.
>
> Furthermore, types are not actually disjoint. You can write a struct
> definition with properties like prop:procedure and prop:evt, and if a
> struct has both, should type-of return the struct’s name, 'procedure, or
> 'evt? It’s not really clear. You might be able to come up with some more
> sophisticated system with (potentially multiple) inheritance that could
> capture these relationships, but I can say with confidence that no such
> system currently exists in Racket.
>
> Alexis
>
> > On Aug 3, 2020, at 09: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 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 the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/C561F2A9-0C78-4EDA-A401-4FB067D79849%40gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaGUiZWoU9mZbqMjB04FSu_kFOGrgyv0riU8TuKtffB_dg%40mail.gmail.com.


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` operation that 
returned a value’s type:

(type-of 'hello) ; => 'symbol
(type-of "hello") ; => 'string

Now suppose you apply type-of to a value you know nothing about and get back 
'widget. Well, you don’t know what a widget is, so that didn’t actually get you 
any further from where you started: you still don’t know what to do with the 
value.

Furthermore, types are not actually disjoint. You can write a struct definition 
with properties like prop:procedure and prop:evt, and if a struct has both, 
should type-of return the struct’s name, 'procedure, or 'evt? It’s not really 
clear. You might be able to come up with some more sophisticated system with 
(potentially multiple) inheritance that could capture these relationships, but 
I can say with confidence that no such system currently exists in Racket.

Alexis

> On Aug 3, 2020, at 09: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 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 the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/C561F2A9-0C78-4EDA-A401-4FB067D79849%40gmail.com.


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 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 the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/20200803141931.t4v4nc2e5d4afx6f%40topoi.pooq.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaEcetXOrk77n1RdFKDteQm_sp-8w8VN7qB54qpi-jMs5A%40mail.gmail.com.


[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 the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200803141931.t4v4nc2e5d4afx6f%40topoi.pooq.com.


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 works nicely in the DrRacket editor.
When DrRacket saves it into a file, it presumably uses some notation that
won't look like a picture in, say, emacs.
But will it still be recognised as an image if I use Racket to run that file?
Can the image be used as a symbol or a constant or is it some other type 
of object?

-- hendrik

> 
> On Sun, Aug 2, 2020 at 7:07 PM Hendrik Boom  wrote:
> 
> > Is there any way to include pictures in Racket code?
> > Perhaps as constants or as prts of identifiers?
> > The idea is that when editing the program in the Racket editor,
> > the pictures are visible as part of the code,
> > making the code itself more visually self-evident,
> > not as file names to be read from elsewhere.
> >
> > -- hendrik
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/20200803020710.d2rvz6gojluubt5t%40topoi.pooq.com
> > .
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CADcuegvJCAHQYwO-eCcqKfqwhrd%2BGr4PELie_e0%3DO9b2PJ_QAA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200803134732.w5lq45vkglq2pmu6%40topoi.pooq.com.


[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, between this release and the next, no bugs are
  discovered in Racket CS that are more serious than those typically
  discovered in Racket BC, then Racket CS will become the default for
  the next release.

* Racket CS supports AArch32 and AArch64, including places and
  futures. The implementation should be considered experimental in this
  initial release.

* Racket CS supports an "incremental" garbage-collection mode that can
  eliminate long GC pauses for some applications, such as animations and
  interactive games.

* Racket CS unboxes local floating-point arithmetic (like Racket BC).

* DrRacket's spell check features lower overhead and has fewer bugs.

* Web Server performance under high concurrency is [better by up to an
  order of magnitude](https://github.com/racket/web-server/pull/94/).
  The Web Server is also more resistant to clients attempting to use
  unconstrained resources.

* The math library includes the Kronecker product.

* Windows supports finer granularity for `sleep` when sleeping for short
  periods of time, improving performance in animation.

* The new prop:struct-field-info property provides static information
  about field names.

* Debugging context in Racket CS is limited to 64,000 frames
  (approximately the same as Racket BC). This reduces the time taken to
  handle out-of-memory failures.

* In `plot`, the legend font and the plot font can be controlled
  independently, and error-bars have an `#:invert?` option.

* The plot and math libraries have new maintainers: Alex Harsányi for
  plot and Pavel Pancheka and Jens Axel Søgaard for math.


The following people contributed to this release:

Alex Harsányi, Alex Knauth, Alexander Shopov, Alexis King, Andrew Kent,
Andrew Mauer-Oats, Atharva Raykar, Ben Greenman, Benjamin Yeung, Bert De
Ketelaere, Bogdan Popa, David Christiansen, David Florness, Diego
Crespo, Fred Fu, Gary Baumgartner, Georges Dupéron, Gustavo Massaccesi,
J. Ian Johnson, Jack Firth, Jay McCarthy, Jens Axel Søgaard, Jesse
Alama, John Clements, Laurent Orseau, Leif Andersen, Luka Hadži-Đokić,
Marc, Matthew Butterick, Matthew Flatt, Matthew Parris, Matthew Turland,
Matthias Felleisen, Michael Ballantyne, Mike Sperber, Noah W M, Paulo
Matos, Pavel Panchekha, Philip McGrath, Raphael Das Gupta, Reuben
Thomas, Ricardo Herdt, Robby Findler, Ryan Culpepper, Sam
Tobin-Hochstadt, Sancho McCann, Sorawee Porncharoenwase, Spencer
Florence, Stephen De Gabrielle, Syntacticlosure, frogbird, kryptine,
rsiddharth, and yurkobb

Feedback Welcome



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/d8b39382-2355-49e5-b3ff-e37de39d6cb0%40mtasv.net.


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 (in-directory "/var/tmp/test")]) (displayln f))

However, the following does not have the same order:

> (current-directory "/var/tmp/test")
> (for/list ([f (in-directory)]) (displayln f))

Does this help? What is interesting to me is that in-directory can call 
directory-list (which seems to call sort) or dir-list, which also calls sort 
and directory-list.

Perhaps I just need to wait for your fix.

Evan
On Monday, August 3, 2020 at 2:28:33 AM UTC-10 Matthew Flatt wrote:

> 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) do not have sorted results, but calls to (in-directory 
> > "path") do have sorted results.
>
> You're right that the documentation's example is incorrect, and I'll
> fix that.
>
> Most examples in the documentation are rendered by running them, so the
> results can't get out-of-sync like this. Since the `in-directory`
> example involves the filesystem, though, the example result is written
> out in the documentation source, and it wasn't updated when the sorting
> guarantee was added to `in-directory`.
>
> Matthew
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/b6b9bf5e-6ea9-46c1-b486-d57b33f80f0bn%40googlegroups.com.


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) do not have sorted results, but calls to (in-directory 
> "path") do have sorted results.

You're right that the documentation's example is incorrect, and I'll
fix that.

Most examples in the documentation are rendered by running them, so the
results can't get out-of-sync like this. Since the `in-directory`
example involves the filesystem, though, the example result is written
out in the documentation source, and it wasn't updated when the sorting
guarantee was added to `in-directory`.

Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200803062825.252%40sirmail.smtps.cs.utah.edu.