laurent.orseau
2020-11-19 09:23:55

Can be used with eq? maybe?


sorawee
2020-11-19 09:59:58

Another possible use is to make it a some variant


sorawee
2020-11-19 10:01:41

Although I prefer using a new gensym as a none variant more.


samth
2020-11-19 14:53:25

There aren’t any uses for immutable boxes, in my experience


samth
2020-11-19 14:54:00

They exist mostly because boxes are in the syntax, and syntax needs to be immutable.


plragde
2020-11-19 20:37:49

do in Racket is something different; it’s an iteration construct inherited from Scheme. Once you understand the idea of store-passing, you’ll notice similar situations. If you want to take care of the boilerplate, you can write a Racket macro. Mutable variables and parameters also help. When I said “do-notation”, I meant for monads in statically typed languages, not Racket. You don’t need to understand this idea any time soon, but when you run across it, you might make the mental connection with store-passing.


badkins
2020-11-19 21:49:04

This was a surprise! I wonder how long multi-line strings have been a thing. I thought for sure I tried them before discovering #<<EOF, but maybe not.


kellysmith12.21
2020-11-20 05:42:26

When writing grammars in defform and related forms, how can I include a literal ...?


kellysmith12.21
2020-11-20 05:43:23

That is, a reference to syntax binding ... and not just printed ellipses.


kellysmith12.21
2020-11-20 05:44:05

I don’t think the #:literals clause would be correct, because I do also want to use the printed ellipses in some parts of the grammar.


sorawee
2020-11-20 06:07:33

@(define lit-ellipsis (racket ...)) Then use #,lit-ellipsis in the grammar section.



sorawee
2020-11-20 06:08:17

See how it’s used in syntax-case


kellysmith12.21
2020-11-20 07:09:55

@sorawee Thanks!


kokou.afidegnon
2020-11-20 07:24:45

sorawee
2020-11-20 07:31:02

No, any is only valid for the returning values from a function.


sorawee
2020-11-20 07:32:19

For example:

  • (lambda (x) x) satisfies (-> any/c any/c)
  • (lambda (x) x) satisfies (-> any/c any)
  • (lambda (x) (values x x)) satisfies (-> any/c any)
  • (lambda (x) (values x x)) does not satisfy (-> any/c any/c)

sorawee
2020-11-20 07:33:16

And (-> any any/c) is not valid syntactically.


kokou.afidegnon
2020-11-20 07:35:15

(-> any/c any/c) do you mean input values and returning values like in type signatures?


sorawee
2020-11-20 07:35:26

Yeah


kokou.afidegnon
2020-11-20 07:35:45

ok


kokou.afidegnon
2020-11-20 07:36:46

thanks,