Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread David Storrs
On Tue, Sep 28, 2021 at 3:30 PM Ben Greenman 
wrote:

> On 9/28/21, David Storrs  wrote:
>
> > Also, any ideas on why the remove fails?
> >
> > $ raco pkg remove try-catch
> > raco pkg remove: invalid `deps' specification
> >   specification: '("base" racket/format racket/string)
> >
> > That is not the deps specification from the info.rkt file so I don't know
> > where it's getting that.
>
> Some package somewhere must have that bad info.rkt file.
>
> A plain "raco setup" might be the quickest way to find the bad one.
> That should print the name of every package as it goes through them.


It did show them right up to the point where it bonked but did not show the
name of the one it bonked on.  Fortunately, since you told me what the
issue was I was able to find it with a simple:

$ find . -name official-racket -prune -o -name info.rkt -exec grep -l
'racket/format' \{} \;

Thanks!


> --
> 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/CAFUu9R5%3DCL-_wfB52aG82Vg9y%2B9HKpQhxk_dX08ub5Ln948QGQ%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/CAE8gKoevcaM26JaaBYVZCORxsXJXVUO9zZNJYR2UPcH_94Rb8Q%40mail.gmail.com.


Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread Ben Greenman
On 9/28/21, David Storrs  wrote:
> *fists of rage*
>
> I'm glad it worked for you, and that it works for me if I repeat your
> steps.  I have no idea why it wasn't working given that I was using the
> local copy of the git repository that is the source of what's on github.
> Argh.

Weird ... glad it's working.

> Regardless, thank you very much for your help.  I've fixed the (for-label
> try-catch), removed the test-more dependency, pushed it to github, and told
> the package server to rescan.  It says it will do that 1 minute from now,
> so hopefully it'll be good to go at that point.  I think documentation only
> gets generated once per day though, right?
>
>
> Also, any ideas on why the remove fails?
>
> $ raco pkg remove try-catch
> raco pkg remove: invalid `deps' specification
>   specification: '("base" racket/format racket/string)
>
> That is not the deps specification from the info.rkt file so I don't know
> where it's getting that.

Some package somewhere must have that bad info.rkt file.

A plain "raco setup" might be the quickest way to find the bad one.
That should print the name of every package as it goes through them.

Or, a "raco pkg remove -f try-catch" should work despite the invalid deps spec.

-- 
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/CAFUu9R5%3DCL-_wfB52aG82Vg9y%2B9HKpQhxk_dX08ub5Ln948QGQ%40mail.gmail.com.


[racket-users] [ANN] try-catch - exception handling with dynamic-wind guarantees

2021-09-28 Thread David Storrs
Module name:  try-catch
https://pkgd.racket-lang.org/pkgn/package/try-catch

Lisp stereotypically has a problem that it's super easy to write your own
code so the library ecosystem ends up fractured, with multiple options to
do the same thing.  McCarthy forbid that I should break the stereotype, so
here's my entry into the try/catch niche.

> (try [shared (define username "bob")]
   [pre (printf "in pre, prepping to handle ~a.\n" username)]
   [(printf "in body. hello, ~a.\n" username)]
   [post (printf "in post, goodbye ~a.\n" username)]
   [catch (symbol? (printf "the symbol was ~a\n" e))]
   [cleanup (printf "in cleanup, done with ~a." username)])
in pre, prepping to handle bob.
in body. hello, bob.
in post, goodbye bob.
in cleanup, done with bob.


pre/body/post are plugged into a dynamic-wind, meaning that the pre clause
is executed before body whenever control enters the body (either normally
or through a continuation jump or etc) and the post clause is executed
whenever control leaves the body.

The catch clause contains subclauses of (predicate handler-expr) that get
fed into a with-handlers, except the handler-exprs are wrapped in a (lambda
(e) ...) in order to reduce boilerplate.  The value 'e' is available to the
handler-expr.

The shared clause does setup before the pre/body are called and the code in
that clause is visible to all subsequent clauses.

The cleanup clause is run iff the body exits without error.

See the documentation for full details and examples.  (Note that the
package server is not currently admitting that there is documentation but
there will be when you install it.)

Competing options:

try  (Typed Racket):  https://pkgs.racket-lang.org/package/try
try-catch-finally and try-catch-finally-lib:
https://pkgs.racket-lang.org/package/try-catch-finally and
https://pkgs.racket-lang.org/package/try-catch-finally-lib
try-catch-match: https://pkgs.racket-lang.org/package/try-catch-match
try-make-sarna-happy:
https://pkgs.racket-lang.org/package/try-make-sarna-happy

My motivation for writing this instead of submitting pull requests was in
part syntactic (the other libraries all use (catch ...) for each of the
catch clauses and I dispreferred the redundancy of typing 'catch' over and
over) and in part because I wanted the 'shared' and 'cleanup' phases which
would have required greater changes to their macros than I was comfortable
submitting.

-- 
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/CAE8gKoeQXhhKatZzjMePd_qbqiNPBOeyX%3DsMqisAVateOBVKrQ%40mail.gmail.com.


Re: [racket-users] [ANN] fmt: a Racket code formatter

2021-09-28 Thread David Storrs
This is very cool, Sorawee.  Thank you for sharing.

On Tue, Sep 28, 2021 at 2:03 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> Announcing the pre-alpha version of fmt, a Racket code formatter. Code
> formatter is a tool that reformats your code so that it conforms to a style
> consistently.
>
>- Source: https://github.com/sorawee/fmt/
>- Documentation and demo: https://docs.racket-lang.org/fmt/
>
> As a part of this work, I implemented Jean-Philippe Bernady’s non greedy
> pretty printer <https://dl.acm.org/doi/10.1145/3110250> (ICFP’17) and
> extended it so that it is practical for actual use.
>
>- Source: https://github.com/sorawee/pprint-compact/
>- Documentation and demo: https://docs.racket-lang.org/pprint-compact/
>
> Hope you find these useful, and let me know if you have any feedback.
>
> Sorawee (Oak)
>
> --
> 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/CADcueguOiOBK4vE3kCfvWYkb2Eaz-JfM5_Yd%3DGct-6umSUEG6w%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CADcueguOiOBK4vE3kCfvWYkb2Eaz-JfM5_Yd%3DGct-6umSUEG6w%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAE8gKodp-Cy3L%2BX%3DH8fSYZwtqLPVFZJVESRp_nOeV7VY_OM8zQ%40mail.gmail.com.


Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread David Storrs
*fists of rage*

I'm glad it worked for you, and that it works for me if I repeat your
steps.  I have no idea why it wasn't working given that I was using the
local copy of the git repository that is the source of what's on github.
Argh.

Regardless, thank you very much for your help.  I've fixed the (for-label
try-catch), removed the test-more dependency, pushed it to github, and told
the package server to rescan.  It says it will do that 1 minute from now,
so hopefully it'll be good to go at that point.  I think documentation only
gets generated once per day though, right?


Also, any ideas on why the remove fails?

$ raco pkg remove try-catch
raco pkg remove: invalid `deps' specification
  specification: '("base" racket/format racket/string)

That is not the deps specification from the info.rkt file so I don't know
where it's getting that.


On Tue, Sep 28, 2021 at 1:36 PM Ben Greenman 
wrote:

> On 9/28/21, David Storrs  wrote:
> > Summary:  Documentation for a new module is not being generated when I
> > would expect it to be and when I do it manually it ends up not linking
> > basic Racket items.  I've done a lot of searching to figure it out and
> > would appreciate some help.
>
> I cloned the try-catch repo (744f217), ran raco pkg install, and got a
> nicely-rendered document. Log attached.
>
> The only problem I saw is that `try` isn't linked. You can fix that by
> adding a `(require (for-label try-catch))`.
>
>
> > Long version:
> >
> > I published a module a few days ago called try-catch.  I have an announce
> > email written up for it but I was waiting for the documentation to
> generate
> > before sending.  It still hasn't generated so today I investigated.
> >
> > First thing I did was make sure that raco was using the local copy for
> > everything:
> >
> > $ raco pkg remove try-catch
> > raco pkg remove: invalid `deps' specification
> >   specification: '("base" racket/format racket/string)
> >
> > Weird.
> >
> > $ raco setup --check-pkg-deps try-catch
> > [...lots of stuff, no problems reported]
> >
> > Okay, whatever.
> >
> > $ raco pkg remove --force try-catch
> >
> > Turn off the WiFi to be certain I don't get the package server version.
> >
> > $ raco pkg install ./try-catch
> >
> > Succeeds, claims that it is building the documentation, does not actually
> > do so.  Ditto when I try
> >
> > $ raco setup try-catch
> >
> > When I manually run
> >
> > $ cd try-catch/scribblings/ && scribble try-catch.scbl
> >
> > I get the try-catch.html file as expected but racket/base functions such
> as
> > with-handlers are not properly linked -- i.e. they appear in blue with a
> > red line under them and are not links.
>
> That's normal. Scribble needs a few command-line flags to know where
> to look for cross references (xrefs). I don't know the right flags
> offhand.
>
>
> > I do not get any missing dependencies when I run
> >
> > My info.rkt file and try-catch.scrbl are both based on those from other
> > modules I have that do work correctly.  I've checked the issues that were
> > pointed out to me the last time I had to ask this question, I've been
> > through the Racket documentation and through Beautiful Racket, and still
> > not found the answer.  Any suggestions?
> >
> >
> > ;; The info.rkt file
> > #lang info
> >
> > (define collection "try-catch")
> > (define version "0.1")
> > (define deps '("base"
> >"syntax-classes-lib"))
> >
> > (define scribblings '(("scribblings/try-catch.scrbl" (
> >
> > (define test-omit-paths '())
> > (define build-deps '("racket-doc"
> >  "scribble-lib"
> >  "rackunit-lib"
> >  "sandbox-lib"))
> >
> > ;;--
> > ;;  The top lines from main.rkt to show the require:
> >
> > #lang racket/base
> >
> > (require (for-syntax racket/base
> >  syntax/parse)
> >  racket/function)
> >
> > ;;--
> > ;; A stripped-down version of scribblings/try-catch.scrbl that
> demonstrates
> > the failures
> >
> > #lang scribble/manual
> >
> > @(require (for-label racket)
> >   racket/sandbox
> >   scribble/example)
> >
> > @defmodule[try-catch]
> >
> > @(define eval
> >(call-with-trusted-sandbox-configuration
> > (lambda ()
> >   

[racket-users] [ANN] fmt: a Racket code formatter

2021-09-28 Thread Sorawee Porncharoenwase
Announcing the pre-alpha version of fmt, a Racket code formatter. Code
formatter is a tool that reformats your code so that it conforms to a style
consistently.

   - Source: https://github.com/sorawee/fmt/
   - Documentation and demo: https://docs.racket-lang.org/fmt/

As a part of this work, I implemented Jean-Philippe Bernady’s non greedy
pretty printer <https://dl.acm.org/doi/10.1145/3110250> (ICFP’17) and
extended it so that it is practical for actual use.

   - Source: https://github.com/sorawee/pprint-compact/
   - Documentation and demo: https://docs.racket-lang.org/pprint-compact/

Hope you find these useful, and let me know if you have any feedback.

Sorawee (Oak)

-- 
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/CADcueguOiOBK4vE3kCfvWYkb2Eaz-JfM5_Yd%3DGct-6umSUEG6w%40mail.gmail.com.


Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread Sorawee Porncharoenwase
>
> When I manually run
>
> $ cd try-catch/scribblings/ && scribble try-catch.scbl
>
> I get the try-catch.html file as expected but racket/base functions such
> as with-handlers are not properly linked -- i.e. they appear in blue with a
> red line under them and are not links.
>

   - As I understand, if you run scribble manually, you need to provide
   additional flags to make links work. I never remember what these flags are
   (perhaps +m?). But if you run Scribble via DrRacket, it should include
   these flags for you automatically.
   - But you can also just view the already rendered docs via raco docs
   try-catch. No need to use scribble again — it’s already run as a
part of raco
   setup. You can re-render it via raco setup. I like this way far better
   since the scribble command generates so many files in the source
   directory that I would need to add to .gitignore (I know --dest exists,
   but I usually forgot to provide it),  but raco setup generates the
   rendered doc either elsewhere or in doc directory, which can be added in
   .gitignore easily (actually it's already in gitignore if you use raco
   pkg new command).

-- 
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/CADcueguB8du0ez9f3USQYo-BRDP-xpFL-SKzdJa6fVx3CZO33A%40mail.gmail.com.


Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread Ben Greenman
On 9/28/21, David Storrs  wrote:
> Summary:  Documentation for a new module is not being generated when I
> would expect it to be and when I do it manually it ends up not linking
> basic Racket items.  I've done a lot of searching to figure it out and
> would appreciate some help.

I cloned the try-catch repo (744f217), ran raco pkg install, and got a
nicely-rendered document. Log attached.

The only problem I saw is that `try` isn't linked. You can fix that by
adding a `(require (for-label try-catch))`.


> Long version:
>
> I published a module a few days ago called try-catch.  I have an announce
> email written up for it but I was waiting for the documentation to generate
> before sending.  It still hasn't generated so today I investigated.
>
> First thing I did was make sure that raco was using the local copy for
> everything:
>
> $ raco pkg remove try-catch
> raco pkg remove: invalid `deps' specification
>   specification: '("base" racket/format racket/string)
>
> Weird.
>
> $ raco setup --check-pkg-deps try-catch
> [...lots of stuff, no problems reported]
>
> Okay, whatever.
>
> $ raco pkg remove --force try-catch
>
> Turn off the WiFi to be certain I don't get the package server version.
>
> $ raco pkg install ./try-catch
>
> Succeeds, claims that it is building the documentation, does not actually
> do so.  Ditto when I try
>
> $ raco setup try-catch
>
> When I manually run
>
> $ cd try-catch/scribblings/ && scribble try-catch.scbl
>
> I get the try-catch.html file as expected but racket/base functions such as
> with-handlers are not properly linked -- i.e. they appear in blue with a
> red line under them and are not links.

That's normal. Scribble needs a few command-line flags to know where
to look for cross references (xrefs). I don't know the right flags
offhand.


> I do not get any missing dependencies when I run
>
> My info.rkt file and try-catch.scrbl are both based on those from other
> modules I have that do work correctly.  I've checked the issues that were
> pointed out to me the last time I had to ask this question, I've been
> through the Racket documentation and through Beautiful Racket, and still
> not found the answer.  Any suggestions?
>
>
> ;; The info.rkt file
> #lang info
>
> (define collection "try-catch")
> (define version "0.1")
> (define deps '("base"
>"syntax-classes-lib"))
>
> (define scribblings '(("scribblings/try-catch.scrbl" (
>
> (define test-omit-paths '())
> (define build-deps '("racket-doc"
>  "scribble-lib"
>  "rackunit-lib"
>  "sandbox-lib"))
>
> ;;--
> ;;  The top lines from main.rkt to show the require:
>
> #lang racket/base
>
> (require (for-syntax racket/base
>  syntax/parse)
>  racket/function)
>
> ;;--
> ;; A stripped-down version of scribblings/try-catch.scrbl that demonstrates
> the failures
>
> #lang scribble/manual
>
> @(require (for-label racket)
>   racket/sandbox
>   scribble/example)
>
> @defmodule[try-catch]
>
> @(define eval
>(call-with-trusted-sandbox-configuration
> (lambda ()
>   (parameterize ([sandbox-output 'string]
>  [sandbox-error-output 'string]
>  [sandbox-memory-limit 50])
> (make-evaluator 'racket)
>
> @itemlist[
> @item{@racket[with-handlers], @racket[~a], @racketmodname[syntax-parse]}
> ]
>
> @examples[
>   #:eval eval
>   #:label #f
>
> (require try-catch)
> (define err (defatalize (raise-arguments-error 'foo "failed")))
> err
> (try [(displayln "ok")])
> ]
>
> --
> 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/CAE8gKoforSuxKVGwj2E_T-_HhLafaFipRGqERh6QUvyn6%2B9MUg%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/CAFUu9R5%2B%3DbdPTXwrNgu1ZKfjzRSOYy03FmMAiRN%2Br2o3DEyoUA%40mail.gmail.com.
> git clone https://github.com/dstorrs/try-catch
Cloning int

[racket-users] Having trouble getting documentation to generate

2021-09-28 Thread David Storrs
Summary:  Documentation for a new module is not being generated when I
would expect it to be and when I do it manually it ends up not linking
basic Racket items.  I've done a lot of searching to figure it out and
would appreciate some help.

Long version:

I published a module a few days ago called try-catch.  I have an announce
email written up for it but I was waiting for the documentation to generate
before sending.  It still hasn't generated so today I investigated.

First thing I did was make sure that raco was using the local copy for
everything:

$ raco pkg remove try-catch
raco pkg remove: invalid `deps' specification
  specification: '("base" racket/format racket/string)

Weird.

$ raco setup --check-pkg-deps try-catch
[...lots of stuff, no problems reported]

Okay, whatever.

$ raco pkg remove --force try-catch

Turn off the WiFi to be certain I don't get the package server version.

$ raco pkg install ./try-catch

Succeeds, claims that it is building the documentation, does not actually
do so.  Ditto when I try

$ raco setup try-catch

When I manually run

$ cd try-catch/scribblings/ && scribble try-catch.scbl

I get the try-catch.html file as expected but racket/base functions such as
with-handlers are not properly linked -- i.e. they appear in blue with a
red line under them and are not links.

I do not get any missing dependencies when I run

My info.rkt file and try-catch.scrbl are both based on those from other
modules I have that do work correctly.  I've checked the issues that were
pointed out to me the last time I had to ask this question, I've been
through the Racket documentation and through Beautiful Racket, and still
not found the answer.  Any suggestions?


;; The info.rkt file
#lang info

(define collection "try-catch")
(define version "0.1")
(define deps '("base"
   "syntax-classes-lib"))

(define scribblings '(("scribblings/try-catch.scrbl" (

(define test-omit-paths '())
(define build-deps '("racket-doc"
 "scribble-lib"
 "rackunit-lib"
 "sandbox-lib"))

;;--
;;  The top lines from main.rkt to show the require:

#lang racket/base

(require (for-syntax racket/base
 syntax/parse)
 racket/function)

;;--
;; A stripped-down version of scribblings/try-catch.scrbl that demonstrates
the failures

#lang scribble/manual

@(require (for-label racket)
  racket/sandbox
  scribble/example)

@defmodule[try-catch]

@(define eval
   (call-with-trusted-sandbox-configuration
(lambda ()
  (parameterize ([sandbox-output 'string]
 [sandbox-error-output 'string]
 [sandbox-memory-limit 50])
(make-evaluator 'racket)

@itemlist[
@item{@racket[with-handlers], @racket[~a], @racketmodname[syntax-parse]}
]

@examples[
  #:eval eval
  #:label #f

(require try-catch)
(define err (defatalize (raise-arguments-error 'foo "failed")))
    err
    (try [(displayln "ok")])
]

-- 
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/CAE8gKoforSuxKVGwj2E_T-_HhLafaFipRGqERh6QUvyn6%2B9MUg%40mail.gmail.com.


[racket-users] Re: Strange readline/racket-mode behavior

2021-09-28 Thread Tony Garnock-Jones
Hi Winston,

I've submitted a suggested improvement to interactive REPLish behaviour 
around read-char and read-line here: 
https://github.com/racket/racket/pull/4007

Please let me know if it improves the situation for you. And of course, if 
anyone else has comments about this kind of thing, please let me know!

Here's the commit comment explaining a little more of the situation:

`winny` on IRC (and subsequently on the mailing list [1]) remarked
that, at the REPL,

```racket
Welcome to Racket v8.2.0.8 [cs].
> (read-line)
""
>
```

which is surprising, since it didn't appear to wait for a line of
input.

Guile does this differently, with its `read-eval-print-loop`
apparently consuming any whitespace after the `read` expression and
before starting the `eval`.

This patch performs a similar trick. In *interactive* contexts
(namely, by action of the default `current-read-interaction`), if
`read-syntax` answers non-`eof`, a procedure
`discard-line-terminators` peeks for and consumes a *single* CR, LF or
CRLF line terminator.

Non-interactive contexts are not affected.

This is very much a special-case in order to improve user experience:
I feel like, because it's an amendment to the REPL and the top-level
is hopeless [2], it's fair game to introduce exceptional handling like
this.

[1]: https://groups.google.com/g/racket-users/c/qUIFqWkkvFs/m/AERXYmfGBgAJ
[2]: https://gist.github.com/samth/3083053

Cheers,
  Tony

On Friday, September 24, 2021 at 9:01:37 PM UTC+2 cr5...@gmail.com wrote:

> Hey everyone,
>
> I was working on a procedure to prompt the user for confirmation and found
> something a bit strange - it did not appear to read for input when usingt
> "racket -i" or in the Emacs Racket REPL buffer. Here is the code:
>
> (define (yn #:read-one-char? [read-one-char? #f])
> (display "y/n: ")
> (flush-output (current-output-port))
> (if read-one-char?
> (match (read-char)
> [(or #\y #\Y) #t]
> [m #f])
> (match (read-line)
> [(or "y" "Y") #t]
> [m #f])))
>
> Regardless if I use read-char or read-line and type y or Y, the behavior 
> seeims
> similar, each of the match's second clause is followed because (read-char)
> returns #\newline whereas read-line returns "" (empty string).
>
> I mentioned this strange behavior on the Libera chat and got an 
> enlightening
> response from tonyg outlining what is happening:
>
> > at the repl, if you type "(read-char)" and press enter, the reader sees 
> ( r e
> > a d - c h a r ) NEWLINE. When it gets to the close-parenthesis, it 
> executes
> > the expression, which reads the NEWLINE character and returns. Similar 
> for
> > read-line, where it sees NEWLINE and returns an empty line
> >
> > try typing (list (read-line) (read-line))
>
> I can confirm tonyg's solution works. The (list (read-char) (read-char)) 
> also
> appears to work, though one always has to type a final newline to send the
> line-buffered input.
>
> The behavior feels very surprising and took me a bit of time to figure out,
> even then I didn't really understand it so I had to ask for help. Can this
> behavior be changed in a future release? Is a reasonable request or could 
> this
> break a lot of code? If this could break stuff, is it worth doing changing 
> it
> anyway, so the behavior is less surprising? I hope to understand if it's
> agreeable to make a PR for this change before investing the time.
>
> Keep on Racketing!
>
> Winston Weinert
> winny.tech
>

-- 
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/c48a0f87-92f8-46b1-baae-6c6813f21337n%40googlegroups.com.


[racket-users] [TFP'22] first call for papers: Trends in Functional Programming 2022, 10-11 February (with Lambda Days 2022 & TFPIE 2022)

2021-09-27 Thread p.achten
 and notification of
acceptance for presentation at the symposium. Authors of draft papers
will be invited to submit revised papers based on the feedback received
at the symposium. A post-symposium refereeing process will then select
a subset of these articles for formal publication.


== Paper categories ==

Draft papers and papers submitted for formal review are submitted as
extended abstracts (4 to 10 pages in length) or full papers (20
pages). The submission must clearly indicate which category it belongs
to: research, position, project, evaluation, or overview paper. It
should also indicate which authors are research students, and whether
the main author(s) are students. A draft paper for which all authors
are students will receive additional feedback by one of the PC members
shortly after the symposium has taken place.

== Format ==

Papers must be written in English, and written using the LNCS
style. For more information about formatting please consult the
Springer LNCS web site.

== Program Committee ==

Program Co-chairs

Nicolas Wu - Imperial College London
Wouter Swierstra - Utrecht University

The remainder of the PC will be announced on the conference website.

-- 
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/7251d829-4c1d-4e16-a32d-60dd3fc51b1dn%40googlegroups.com.


[racket-users] The Animated Guide to Symex (for Emacs users)

2021-09-26 Thread Siddhartha Kasivajhula
Hi all,
I posted this on Reddit but I'm not sure if anyone noticed it there, so I'm
reposting it here since I think it could be useful to fellow Emacs / Racket
Mode users.

This is an animated guide to a Lisp structural editing package for Emacs
(that I authored) similar to paredit and lispy, but with a very different
approach -- in particular, it uses a DSL internally to describe arbitrary
traversals over the code, and exposes the functionality in a modal
interface implemented as an Evil state (but you don't need to be an Evil
user to use it). I think it provides a very clean and expressive editing
experience. It also has special support for Racket since, obviously, I
write Racket :). Take a look:

https://countvajhula.com/2021/09/25/the-animated-guide-to-symex/

-Sid

-- 
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/CACQBWF%3D8FdfPuSzNT-WPQb%3DVXSzkKzg%3DA-8uOy2MnpbOj1vEqQ%40mail.gmail.com.


[racket-users] Upcoming lisp game jams

2021-09-25 Thread Stephen De Gabrielle
There have been a couple of lisp game jams announced lately:

https://itch.io/jam/longgame-tech-innovation-jam-6-shrink September 26th -
27th
https://itch.io/jam/autumn-lisp-game-jam-2021 October 15th - 25th

If you are thinking of using Racket, some resources are collected at

https://github.com/racket/racket/wiki/Game-Development

and don’t forget the excellent 2htdp/universe
https://docs.racket-lang.org/teachpack/2htdpuniverse.html

bw

Stephen
-- 


-- 
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/CAGHj7-LPP6n_V7BBQ9jdgY3h6XWnBuOes63JVhu%2BbNCHb_1gXg%40mail.gmail.com.


Re: [racket-users] Announcing Fission Flare, a falling block video game

2021-09-24 Thread Christine Lemmer-Webber
Looks very fun. :)

Ryan Kramer  writes:

> I've just released v0.1 of a falling block video game:
> https://github.com/default-kramer/fission-flare It draws a lot of
> inspiration from Dr Mario but I don't like to advertise that since my
> game has plenty of unique ideas. And although the patent on Dr Mario
> has expired, I'm not a lawyer and I don't want to invite trouble.
>
> The game is 100% Racket, most of it Typed. The graphics are all done
> using pict. Perhaps I'll start a blog and write up some of the more
> interesting things I learned, but not today.
>
> Warning - it can be pretty addicting! Well over 90% of my
> "development" time was just me playing the game.

-- 
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/87bl4huypp.fsf%40dustycloud.org.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread Robby Findler
Another approach is to give it a name in the documentation and use that
name (following Jay's earlier message).

Robby


On Fri, Sep 24, 2021 at 1:37 PM 'John Clements' via Racket Users <
racket-users@googlegroups.com> wrote:

> I think I wouldn’t say “accepts”; I usually reserve this term for
> functions, but that’s a minor quibble.
>
> I think I would call these “clauses”, as in
>
> “With-handlers allows the user to specify exception-handling clauses. Each
> one includes two parts: a predicate, indicating whether blah blah blah, and
> a handler, which is called blah blah blah.”
>
> No?
>
> John
>
> > On Sep 24, 2021, at 11:28, David Storrs  wrote:
> >
> >
> >
> > On Fri, Sep 24, 2021 at 1:49 PM Jay McCarthy 
> wrote:
> > I think the word you're looking for is "syntax". Many people think that
> languages like Racket "don't have syntax" or "have uniform syntax", but
> this is an example of how that is incorrect. Each macro has its own unique
> syntax and this is an example of how `let` has a unique syntax where `(`
> does _not_ mean "apply a function" or "apply a macro".
> >
> > As a poor analogy, many human languages have a wide set of phonemes and
> you combine those in certain rules (like you can't have 27 consonant sounds
> in a row) and then use them in wider situations that we call grammar. I
> like to think that languages like C has lots of phonemes and little
> grammar, because there are lots of rules about how to form "C words" but
> basically no rules for how to form "C sentences", because there's a lot of
> uniformity in how expressions and statements combine. In contrast,
> languages like Racket have very few phonemes (this is what I think people
> mean why they say "there is no syntax") but many varied rules (in fact,
> arbitrary, because macros can customize them) for combining those smaller
> units.
> >
> > So there's no specific term for this structure?  I was looking for a
> standardized way to say something like "with-handlers accepts a group of
> two-element groups where each subgroup consists of a predicate and an
> action."
> >
> > Jay
> >
> > --
> > Jay McCarthy
> > Associate Professor @ CS @ UMass Lowell
> > http://jeapostrophe.github.io
> > Vincit qui se vincit.
> >
> >
> > On Fri, Sep 24, 2021 at 1:25 PM David Storrs 
> wrote:
> > Racket has a number of forms that include what look like lists of lists
> but are not.  For example:  (let ((foo 7) (bar 8)) ...)
> >
> > What would the '(foo 7)' and '(bar 8)' elements be called?  Groups,
> maybe?
> >
> > --
> > 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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%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/CAE8gKoeM6YYgpj-4Ey%2BoSSKRS%2BfMch3d0GDu85f9mwHmtxwVig%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/11a531ce-22f2-4f23-8246-46c6c77ffae7%40mtasv.net
> .
>

-- 
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/CAL3TdOOx5LWptTUbHzxFp5BbcS73ikkq%2B4FMm25YmGdVY3N1VA%40mail.gmail.com.


Re: [racket-users] Strange readline/racket-mode behavior

2021-09-24 Thread David Storrs
The dev team will have to answer your actual question, but I thought I
might offer a more compact solution that incorporates the fix you mentioned:

(define (yn #:read-one-char? [read-one-char? #f])
  (display "y/n: ")
  (flush-output (current-output-port))
  (define func (if read-one-char? read-char read-line))
  (match (list (func) (func))
[(list _ (or #\y #\Y "y" "Y")) #t]
[_ #f]))

On Fri, Sep 24, 2021 at 3:01 PM Winston Weinert  wrote:

> Hey everyone,
>
> I was working on a procedure to prompt the user for confirmation and found
> something a bit strange - it did not appear to read for input when usingt
> "racket -i" or in the Emacs Racket REPL buffer.  Here is the code:
>
> (define (yn #:read-one-char? [read-one-char? #f])
>   (display "y/n: ")
>   (flush-output (current-output-port))
>   (if read-one-char?
>   (match (read-char)
> [(or #\y #\Y) #t]
> [m #f])
>   (match (read-line)
> [(or "y" "Y") #t]
> [m #f])))
>
> Regardless if I use read-char or read-line and type y or Y, the behavior
> seeims
> similar, each of the match's second clause is followed because (read-char)
> returns #\newline whereas read-line returns "" (empty string).
>
> I mentioned this strange behavior on the Libera chat and got an
> enlightening
> response from tonyg outlining what is happening:
>
> > at the repl, if you type "(read-char)" and press enter, the reader sees
> ( r e
> > a d - c h a r ) NEWLINE. When it gets to the close-parenthesis, it
> executes
> > the expression, which reads the NEWLINE character and returns. Similar
> for
> > read-line, where it sees NEWLINE and returns an empty line
> >
> > try typing (list (read-line) (read-line))
>
> I can confirm tonyg's solution works.  The (list (read-char) (read-char))
> also
> appears to work, though one always has to type a final newline to send the
> line-buffered input.
>
> The behavior feels very surprising and took me a bit of time to figure out,
> even then I didn't really understand it so I had to ask for help.  Can this
> behavior be changed in a future release?  Is a reasonable request or could
> this
> break a lot of code?  If this could break stuff, is it worth doing
> changing it
> anyway, so the behavior is less surprising?  I hope to understand if it's
> agreeable to make a PR for this change before investing the time.
>
> Keep on Racketing!
>
> Winston Weinert
> winny.tech
>
> --
> 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/20210924190134.mjxttwqtgeunjbus%40ml1.net
> .
>

-- 
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/CAE8gKoeXrgNa%2BAkUgbX4sBi77y7wPM0AhRLvrwVfrtKTAyaPCQ%40mail.gmail.com.


[racket-users] Strange readline/racket-mode behavior

2021-09-24 Thread Winston Weinert
Hey everyone,

I was working on a procedure to prompt the user for confirmation and found
something a bit strange - it did not appear to read for input when usingt
"racket -i" or in the Emacs Racket REPL buffer.  Here is the code:

(define (yn #:read-one-char? [read-one-char? #f])
  (display "y/n: ")
  (flush-output (current-output-port))
  (if read-one-char?
  (match (read-char)
[(or #\y #\Y) #t]
[m #f])
  (match (read-line)
[(or "y" "Y") #t]
[m #f])))

Regardless if I use read-char or read-line and type y or Y, the behavior seeims
similar, each of the match's second clause is followed because (read-char)
returns #\newline whereas read-line returns "" (empty string).

I mentioned this strange behavior on the Libera chat and got an enlightening
response from tonyg outlining what is happening:

> at the repl, if you type "(read-char)" and press enter, the reader sees ( r e
> a d - c h a r ) NEWLINE. When it gets to the close-parenthesis, it executes
> the expression, which reads the NEWLINE character and returns. Similar for
> read-line, where it sees NEWLINE and returns an empty line
>
> try typing (list (read-line) (read-line))

I can confirm tonyg's solution works.  The (list (read-char) (read-char)) also
appears to work, though one always has to type a final newline to send the
line-buffered input.

The behavior feels very surprising and took me a bit of time to figure out,
even then I didn't really understand it so I had to ask for help.  Can this
behavior be changed in a future release?  Is a reasonable request or could this
break a lot of code?  If this could break stuff, is it worth doing changing it
anyway, so the behavior is less surprising?  I hope to understand if it's
agreeable to make a PR for this change before investing the time.

Keep on Racketing!

Winston Weinert
winny.tech

-- 
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/20210924190134.mjxttwqtgeunjbus%40ml1.net.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread Jay McCarthy
On Fri, Sep 24, 2021 at 2:45 PM David Storrs  wrote:

> Offtopic question for someone else:  Jay, are you related to
> Lisp-inventory John McCarthy?
>

Nope, although we have the same name and nickname

Jay

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.

-- 
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/CAJYbDa%3DEoeBeor0MceS%2BqSNGoKt5UwmZfyk6Y65Vi-OTLj5AEA%40mail.gmail.com.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
On Fri, Sep 24, 2021 at 2:37 PM John Clements 
wrote:

> I think I wouldn’t say “accepts”; I usually reserve this term for
> functions, but that’s a minor quibble.
>
> I think I would call these “clauses”, as in
>
> “With-handlers allows the user to specify exception-handling clauses. Each
> one includes two parts: a predicate, indicating whether blah blah blah, and
> a handler, which is called blah blah blah.”
>
> No?
>
> John
>

That seems reasonable.  Thanks, John.



Offtopic question for someone else:  Jay, are you related to Lisp-inventory
John McCarthy?

-- 
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/CAE8gKocbqx7n7uTjAypSMQoQcFjFfaOD%2BKp93m5mf8iQ3fd%2B7g%40mail.gmail.com.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread 'John Clements' via Racket Users
I think I wouldn’t say “accepts”; I usually reserve this term for functions, 
but that’s a minor quibble.

I think I would call these “clauses”, as in

“With-handlers allows the user to specify exception-handling clauses. Each one 
includes two parts: a predicate, indicating whether blah blah blah, and a 
handler, which is called blah blah blah.”

No?

John

> On Sep 24, 2021, at 11:28, David Storrs  wrote:
> 
> 
> 
> On Fri, Sep 24, 2021 at 1:49 PM Jay McCarthy  wrote:
> I think the word you're looking for is "syntax". Many people think that 
> languages like Racket "don't have syntax" or "have uniform syntax", but this 
> is an example of how that is incorrect. Each macro has its own unique syntax 
> and this is an example of how `let` has a unique syntax where `(` does _not_ 
> mean "apply a function" or "apply a macro".
> 
> As a poor analogy, many human languages have a wide set of phonemes and you 
> combine those in certain rules (like you can't have 27 consonant sounds in a 
> row) and then use them in wider situations that we call grammar. I like to 
> think that languages like C has lots of phonemes and little grammar, because 
> there are lots of rules about how to form "C words" but basically no rules 
> for how to form "C sentences", because there's a lot of uniformity in how 
> expressions and statements combine. In contrast, languages like Racket have 
> very few phonemes (this is what I think people mean why they say "there is no 
> syntax") but many varied rules (in fact, arbitrary, because macros can 
> customize them) for combining those smaller units.
> 
> So there's no specific term for this structure?  I was looking for a 
> standardized way to say something like "with-handlers accepts a group of 
> two-element groups where each subgroup consists of a predicate and an action."
> 
> Jay
> 
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
> 
> 
> On Fri, Sep 24, 2021 at 1:25 PM David Storrs  wrote:
> Racket has a number of forms that include what look like lists of lists but 
> are not.  For example:  (let ((foo 7) (bar 8)) ...)
> 
> What would the '(foo 7)' and '(bar 8)' elements be called?  Groups, maybe?
> 
> -- 
> 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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%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/CAE8gKoeM6YYgpj-4Ey%2BoSSKRS%2BfMch3d0GDu85f9mwHmtxwVig%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/11a531ce-22f2-4f23-8246-46c6c77ffae7%40mtasv.net.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
On Fri, Sep 24, 2021 at 1:49 PM Jay McCarthy  wrote:

> I think the word you're looking for is "syntax". Many people think that
> languages like Racket "don't have syntax" or "have uniform syntax", but
> this is an example of how that is incorrect. Each macro has its own unique
> syntax and this is an example of how `let` has a unique syntax where `(`
> does _not_ mean "apply a function" or "apply a macro".
>
> As a poor analogy, many human languages have a wide set of phonemes and
> you combine those in certain rules (like you can't have 27 consonant sounds
> in a row) and then use them in wider situations that we call grammar. I
> like to think that languages like C has lots of phonemes and little
> grammar, because there are lots of rules about how to form "C words" but
> basically no rules for how to form "C sentences", because there's a lot of
> uniformity in how expressions and statements combine. In contrast,
> languages like Racket have very few phonemes (this is what I think people
> mean why they say "there is no syntax") but many varied rules (in fact,
> arbitrary, because macros can customize them) for combining those smaller
> units.
>

So there's no specific term for this structure?  I was looking for a
standardized way to say something like "with-handlers accepts a group of
two-element groups where each subgroup consists of a predicate and an
action."

>
> Jay
>
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
>
>
> On Fri, Sep 24, 2021 at 1:25 PM David Storrs 
> wrote:
>
>> Racket has a number of forms that include what look like lists of lists
>> but are not.  For example:  (let ((foo 7) (bar 8)) ...)
>>
>> What would the '(foo 7)' and '(bar 8)' elements be called?  Groups, maybe?
>>
>> --
>> 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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAE8gKoeM6YYgpj-4Ey%2BoSSKRS%2BfMch3d0GDu85f9mwHmtxwVig%40mail.gmail.com.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
On Fri, Sep 24, 2021 at 1:40 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> It's usually called "binding pair". See also
> https://docs.racket-lang.org/syntax/stxparse-intro.html which defines a
> syntax class describing the said structure.
>

Okay, but what about in (with-handlers ((symbol? (lambda (e) (displayln
e  ...)?  That's an association between two things but not a binding
pair.  Also, sorry, I should have been clearer up front by giving more than
the one example.


> On Fri, Sep 24, 2021 at 10:25 AM David Storrs 
> wrote:
>
>> Racket has a number of forms that include what look like lists of lists
>> but are not.  For example:  (let ((foo 7) (bar 8)) ...)
>>
>> What would the '(foo 7)' and '(bar 8)' elements be called?  Groups, maybe?
>>
>> --
>> 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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAE8gKocWRCn_EJuuD5ZSGXfUEOz8OgV9s6dZt4NsHgWGUBhCgg%40mail.gmail.com.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread Robby Findler
An answer to a third question that might also have been the one that was
asked :)

You might call it a "sequence".

Robby


On Fri, Sep 24, 2021 at 12:50 PM Jay McCarthy 
wrote:

> I think the word you're looking for is "syntax". Many people think that
> languages like Racket "don't have syntax" or "have uniform syntax", but
> this is an example of how that is incorrect. Each macro has its own unique
> syntax and this is an example of how `let` has a unique syntax where `(`
> does _not_ mean "apply a function" or "apply a macro".
>
> As a poor analogy, many human languages have a wide set of phonemes and
> you combine those in certain rules (like you can't have 27 consonant sounds
> in a row) and then use them in wider situations that we call grammar. I
> like to think that languages like C has lots of phonemes and little
> grammar, because there are lots of rules about how to form "C words" but
> basically no rules for how to form "C sentences", because there's a lot of
> uniformity in how expressions and statements combine. In contrast,
> languages like Racket have very few phonemes (this is what I think people
> mean why they say "there is no syntax") but many varied rules (in fact,
> arbitrary, because macros can customize them) for combining those smaller
> units.
>
> Jay
>
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
>
>
> On Fri, Sep 24, 2021 at 1:25 PM David Storrs 
> wrote:
>
>> Racket has a number of forms that include what look like lists of lists
>> but are not.  For example:  (let ((foo 7) (bar 8)) ...)
>>
>> What would the '(foo 7)' and '(bar 8)' elements be called?  Groups, maybe?
>>
>> --
>> 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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAJYbDamFTUsORe%3D07H9FROrA0bcYFbFv0PqFdapey0JqsQ-bPQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAJYbDamFTUsORe%3D07H9FROrA0bcYFbFv0PqFdapey0JqsQ-bPQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAL3TdONf2uFBvn7gK62Sm2S8TQa%3DSM-Pefp-khWJ9st2PnFytA%40mail.gmail.com.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread Jay McCarthy
I think the word you're looking for is "syntax". Many people think that
languages like Racket "don't have syntax" or "have uniform syntax", but
this is an example of how that is incorrect. Each macro has its own unique
syntax and this is an example of how `let` has a unique syntax where `(`
does _not_ mean "apply a function" or "apply a macro".

As a poor analogy, many human languages have a wide set of phonemes and you
combine those in certain rules (like you can't have 27 consonant sounds in
a row) and then use them in wider situations that we call grammar. I like
to think that languages like C has lots of phonemes and little grammar,
because there are lots of rules about how to form "C words" but basically
no rules for how to form "C sentences", because there's a lot of uniformity
in how expressions and statements combine. In contrast, languages like
Racket have very few phonemes (this is what I think people mean why they
say "there is no syntax") but many varied rules (in fact, arbitrary,
because macros can customize them) for combining those smaller units.

Jay

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.


On Fri, Sep 24, 2021 at 1:25 PM David Storrs  wrote:

> Racket has a number of forms that include what look like lists of lists
> but are not.  For example:  (let ((foo 7) (bar 8)) ...)
>
> What would the '(foo 7)' and '(bar 8)' elements be called?  Groups, maybe?
>
> --
> 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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAJYbDamFTUsORe%3D07H9FROrA0bcYFbFv0PqFdapey0JqsQ-bPQ%40mail.gmail.com.


Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread Sorawee Porncharoenwase
It's usually called "binding pair". See also
https://docs.racket-lang.org/syntax/stxparse-intro.html which defines a
syntax class describing the said structure.

On Fri, Sep 24, 2021 at 10:25 AM David Storrs 
wrote:

> Racket has a number of forms that include what look like lists of lists
> but are not.  For example:  (let ((foo 7) (bar 8)) ...)
>
> What would the '(foo 7)' and '(bar 8)' elements be called?  Groups, maybe?
>
> --
> 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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CADcuegt0egonqm7iXsXGUBZ-Z9SbetTMMp7FaPn0Qii6fZuy%2BQ%40mail.gmail.com.


[racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
Racket has a number of forms that include what look like lists of lists but
are not.  For example:  (let ((foo 7) (bar 8)) ...)

What would the '(foo 7)' and '(bar 8)' elements be called?  Groups, maybe?

-- 
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/CAE8gKodX800fK45c_dyVFCNB-AKmYmK26DxC42ZRDVHdzJ2Q7g%40mail.gmail.com.


Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-23 Thread jackh...@gmail.com
This looks quite a bit like you're trying to implement tracing, which is 
like logging, but instead of emitting messages associated with *points* in 
time, you emit messages for *ranges* of time. Rust has an excellent library 
<https://docs.rs/tracing/0.1.28/tracing/> for tracing. Perhaps that will 
provide some good inspiration?

On Friday, September 3, 2021 at 8:30:18 AM UTC-7 david@gmail.com wrote:

> On Thu, Sep 2, 2021 at 5:32 PM Sorawee Porncharoenwase <
> sorawe...@gmail.com> wrote:
>
>> Thoughts:
>>
>>- Perhaps the logger should be optional. The default value would be 
>>(current-logger). 
>>- The event name (like on-complete) could also be optional. The 
>>default would be the source location of the macro invocation site 
>>- Instead of “time: ~a”, I think it would be nice to support many 
>>“pairs”, which are formatted like raise-arguments-error. 
>>
>> Example:
>>
>> (define (on-complete x)
>>   (log-test-debug "I'm in on-complete")
>>   x)
>>
>> (with-log ()
>>   1)
>>
>> (with-log (#:logger test-debug
>>#:msg "on-complete"
>>["time" (current-seconds)])
>>   (on-complete (person 'bob)))
>>
>> would output:
>>
>> test: entering test.rkt:5:1
>> test: exiting test.rkt:5:1
>> result: 1
>> 1
>> test: entering on-complete
>> time: 123
>> test: I'm in on-complete
>> test: exiting on-complete
>> time: 124
>> result: (person 'bob)
>> (person 'bob)
>>
>>
>>
> First of all, thank you.  I like the idea of the event name being optional 
> and the logger defaulting but I'm not keen on the syntax.  It's very 
> verbose for something that might occasionally be wrapped around a single 
> line of code. The raise-arguments-error formatting would be a nice default 
> but I prefer to give the option to use a format string if you want 
> something different.
>
>
>> On Thu, Sep 2, 2021 at 2:06 PM Martin DeMello  
>> wrote:
>>
>>> I do like the second form better, especially since the actual code being 
>>> run is not obscured by simply being the last argument to a long log 
>>> function.
>>>
>>
> Cool.  I'll move towards that.
>
>
>>> martin
>>>
>>> On Thu, Sep 2, 2021 at 1:55 PM David Storrs  wrote:
>>>
>>>> I often find that for debugging I want to see a log message saying "I'm 
>>>> about to do X" followed by X followed by "I'm done with X" and I want it 
>>>> to 
>>>> return the result of X.
>>>>
>>>> I wrote this macro and posted it to the package server:  
>>>> https://pkgs.racket-lang.org/package/log-bracketed
>>>>
>>>> In retrospect, the syntax is bad and I should change it.  Can anyone 
>>>> suggest something better?
>>>>
>>>>   (define (on-complete x) (log-test-debug "entering on-complete") x)
>>>>   (struct person (name) #:transparent)
>>>>
>>>>   (log-bracketed test-debug "on-complete" "time: ~a" (current-seconds) 
>>>> (on-complete (person 'bob)))
>>>>   (log-bracketed test-debug "on-complete" "" "no user-specified logging 
>>>> information")
>>>>
>>>> Spits out:
>>>>
>>>>
>>>> test: about to on-complete. time: 1630611613
>>>> test: entering on-complete
>>>> test: after on-complete. time: 1630611613. result: (person 'bob)
>>>> (person 'bob)
>>>> test: about to on-complete
>>>> test: after on-complete. result: "no user-specified logging information"
>>>> "no user-specified logging information"
>>>>
>>>>
>>>> The problem is that this looks like it's a simple logging message when 
>>>> in fact it's real code that should not be ignored.  I'm trying to think of 
>>>> a better way to do it...maybe something like this?:
>>>>
>>>>   (with-bracketing-logs ([test-debug "on-complete" "time: ~a" 
>>>> (current-seconds)])
>>>>
>>>>  (on-complete (person 'bob))
>>>>
>>>>
>>>>
>>>> -- 
>>>> 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

[racket-users] Announcing Fission Flare, a falling block video game

2021-09-23 Thread Ryan Kramer
I've just released v0.1 of a falling block video game: 
https://github.com/default-kramer/fission-flare It draws a lot of 
inspiration from Dr Mario but I don't like to advertise that since my game 
has plenty of unique ideas. And although the patent on Dr Mario has 
expired, I'm not a lawyer and I don't want to invite trouble.

The game is 100% Racket, most of it Typed. The graphics are all done using 
pict. Perhaps I'll start a blog and write up some of the more interesting 
things I learned, but not today. 

Warning - it can be pretty addicting! Well over 90% of my "development" 
time was just me playing the game.

-- 
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/d4c9e068-a44f-41bd-854a-ee7c286b98fbn%40googlegroups.com.


Re: [racket-users] [ANN] Introducing "social" contracts

2021-09-23 Thread Nathaniel W Griswold
The changes look good, i like the idea of this.

> On Aug 25, 2021, at 10:59 AM, Siddhartha Kasivajhula  
> wrote:
> 
> Hello again folks,
> I recently migrated one of my repos to use social-contract, and thought I'd 
> share the before/after as an example to illustrate what the package does:
> 
> https://github.com/countvajhula/seq/commit/c959be577448640e00ab7015bdaddabb7f8b49ba?branch=c959be577448640e00ab7015bdaddabb7f8b49ba=split

-- 
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/ED34FB18-A06C-4CE6-B15B-4680D7B6F3E0%40nan.sh.


[racket-users] Re: Writing to serial port?

2021-09-23 Thread Zeta Convex
Ah, OK. It seems fairly straightforward:

(system "stty -F /dev/ttyACM0 115200 crtscts")

(define out 0)
(set! out (open-output-file "/dev/ttyACM0" #:mode 'binary #:exists 'append))
;(set! in  (open-input-file  port-name #:mode 'binary))
(file-stream-buffer-mode out 'none)
(write-byte whatever out)

(close-output-port out)

On Thursday, 23 September 2021 at 18:31:53 UTC+1 Zeta Convex wrote:

>
> How do I write to a serial port? I'm on Linux, and want a baud rate of 
> 115200.
>
> I'm new to Scheme. I can't seem to find a library to do what I want.
>

-- 
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/2ee59fe3-1543-4fea-80ea-a03cc72aa014n%40googlegroups.com.


[racket-users] Writing to serial port?

2021-09-23 Thread Zeta Convex

How do I write to a serial port? I'm on Linux, and want a baud rate of 
115200.

I'm new to Scheme. I can't seem to find a library to do what I want.

-- 
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/b9d76bfd-6c40-4f12-b9ad-7cc1947ce047n%40googlegroups.com.


Re: [racket-users] Autumn Lisp Game Jam 2021

2021-09-23 Thread Stephen De Gabrielle
There is a collection of links that may be useful for games at
https://github.com/racket/racket/wiki/Game-Development

And don’t forget 2htdp/universe can be used from #lang racket

Bw
Stephen

On Thu, 23 Sep 2021 at 09:16, Bruce O'Neel  wrote:

>
> This might interest some of you...
>
> Autumn Lisp Game Jam 2021 - itch.io
> <https://itch.io/jam/autumn-lisp-game-jam-2021>
>
> --
> 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/b887503f3a7781fe1681abbaf6e50969%40mail.infomaniak.com
> <https://groups.google.com/d/msgid/racket-users/b887503f3a7781fe1681abbaf6e50969%40mail.infomaniak.com?utm_medium=email_source=footer>
> .
>
-- 


-- 
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/CAGHj7-%2BuPxb3E6BEUEQT437wPzO32RFSEBT-xhbRz_%3DjYvsDuw%40mail.gmail.com.


[racket-users] Autumn Lisp Game Jam 2021

2021-09-23 Thread Bruce O'Neel
This might interest some of you...

Autumn Lisp Game Jam 2021 - itch.io
[https://itch.io/jam/autumn-lisp-game-jam-2021]

-- 
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/b887503f3a7781fe1681abbaf6e50969%40mail.infomaniak.com.


Re: [racket-users] using raco to install executables

2021-09-22 Thread Sage Gerard
Yes. The keyword here is "launcher." See the gracket-launcher* and
racket-launcher-* options for info.rkt files in
https://docs.racket-lang.org/raco/setup-info.html

These options affect `raco setup` in particular. Here's one of my
info.rkt files as an example
https://github.com/zyrolasting/polyglot/blob/master/polyglot-lib/polyglot/info.rkt

On 9/21/21 12:34 PM, Roger Keays wrote:
> Can you use raco to install executables on the system path like with 
> python/pip?
>
> --
> 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/sigid.1898dec7b9.20210921163404.GC5208%40papaya.papaya.

-- 
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/295fe146-84ad-9c67-3b33-53167a486a0f%40sagegerard.com.


[racket-users] Call for Tutorials and Workshops: PLDI 2022

2021-09-21 Thread 'William J. Bowman' via Racket Users
Please distribute widely:

# Call for Workshops and Tutorials

PLDI 2022 is a world-class forum for researchers and practitioners in 
programming language design and implementation. As in previous years, PLDI is 
soliciting proposals for co-located workshops and tutorials that will take 
place on Monday June 20th, and Tuesday June 21st. Please propose your workshop 
or tutorial via the submission system.

The following details will be asked on submission:

* Name of the workshop/tutorial.
* Duration of the workshop/tutorial.
* Organizers: names, affiliation, contact information, brief (100 words) 
biography.
* A short description (150-200 words) of the topic.
* Event format: workshop/tutorial; type of submissions, if any; review process; 
results dissemination.
* Expected attendance and target audience within the PLDI community.
* How you plan to foster an inclusive environment and promote a diverse 
attendance.
* Information on any previous iterations of the workshop or tutorial.

*Note:* Workshops must make their own acceptance decisions by April 21, 2022 if 
there will be proceedings (final versions due May 5, 2022), or May 5, 2022.

## Submission
Submission site: 
https://pldi22.sigplan.org/createProposal/d625158d-7188-4844-88cd-9bf71182aa9a

Workshops that would like their proceedings included in the ACM Digital Library 
must submit a proposal by November 18, 2021.

Workshops and tutorials that will have no formal proceedings should submit a 
proposal by November 30, 2021.

## Review

Proposals are reviewed by the Workshop and Tutorials Chairs, and if necessary, 
by the PLDI general chair.

* Proposals will be evaluated according to the relevance of the topic, the 
expertise and experience of the workshop organizers, and their potential to 
attract participants.
* Proposals submitted between November 18th and 30th will be evaluated on a 
first-come-first-served basis.

## Notification

We will notify workshop/tutorial acceptance by December 9th.

## Timeline

Submission deadline (with proceedings): November 18

Submission deadline (no proceedings): November 30

Notification: December 9

## Dissemination

A proposal should clearly state how the results of the workshop — i.e., 
published papers and other outcomes — will be made available to participants 
and others before and after the workshop event. The Workshops and Tutorials 
Chair will provide guidance to the organizers of accepted workshops that wish 
to publish proceedings in the ACM Digital Library. For those that choose to 
publish their papers in ACM Digital Library, please add the following text in 
the workshop call for papers and on the website:

*AUTHORS TAKE NOTE:* The official publication date is the date the proceedings 
are made available in the ACM Digital Library. This date may be up to two weeks 
prior to the first day of your conference. The official publication date 
affects the deadline for any patent filings related to published work. (For 
those rare conferences whose proceedings are published in the ACM Digital 
Library after the conference is over, the official publication date remains the 
first day of the conference.)

Workshops that elect to publish proceedings can do so in the ACM Digital 
Library with sponsoring by SIGPLAN. The application for SIGPLAN sponsorship 
includes reviewing the proposed program committee with the SIGPLAN Executive 
Committee, a process which the chairs will help facilitate.

## Workshop Co-Chairs
- Nadia Polikarpova, U. of California at San Diego
- Alexandra Silva, U. College London

-- 
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/YUo3Bf8aFrLcIBgm%40williamjbowman.com.


[racket-users] using raco to install executables

2021-09-21 Thread Roger Keays
Can you use raco to install executables on the system path like with python/pip?

-- 
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/sigid.1898dec7b9.20210921163404.GC5208%40papaya.papaya.


[racket-users] Rhombus brainstorming discussion

2021-09-20 Thread Matthew Flatt
For anyone interested in Rhombus, I'd like to make sure you're aware
that we recently turned on the discussions feature at the GitHub repo:

  https://github.com/racket/rhombus-brainstorming/discussions

More generally, we've accumulated a large number of ideas and wishes at
that repo, mostly in the form of issues. There are a handful of
concrete proposals in the form of pull requests. There is a candidate
experiment prototype based on a group of the proposals. Those proposals
and the implementation have evolved a lot through discussion in the PRs
and issues.

The discussion is ongoing, but we're likely getting to the end of the
brainstorming phase.


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/20210920095909.3fc%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] Help debugging handin client connection problem

2021-09-19 Thread 'William J. Bowman' via Racket Users
I think I've debugged the issue, but it's only present in our locally modified 
version of the client, although the root cause could affects others. In case 
others have minor modifications to the client, or anyone modifies the client in 
the future:

It was a race condition between some error checking logic and connection 
initialization. If the error occured before the connection initialized, then 
the connection would be hung. I'm guessing this is related to the `go-sema` but 
I'm not entirely sure.

We added some additional error checking that happens at line:
  
https://github.com/racket/handin/blob/ac08937cc6b1eca8abe3d4d4df59876f95cbea17/handin-client/client-gui.rkt#L353
We simply checked that the current file was saved and raised an error if not:
> (unless filename
>   (report-error "File is not saved. Please save the file and try again."))

This occurs in parallel with initializing the connection:
  
https://github.com/racket/handin/blob/ac08937cc6b1eca8abe3d4d4df59876f95cbea17/handin-client/client-gui.rkt#L345

If the error checking raises an error before the connection is established, it 
seems that the connection logic completely hangs, and the connection can never 
be used.

We can't move the error checking BEFORE the initialization, since 
`report-error` relies on the `comm-cust` variable, which is initialized through 
mutation by `(init-comm)`.

Instead, I've moved the error reporting to happen AFTER the connection has 
definitely been established, right before a user tries to submit. This is a 
shame, since it principle it can happen in parallel with initialization, but I 
can figure out how to untangle this code enough to do that without risking the 
race condition.

--
William J. Bowman

On Sat, Sep 18, 2021 at 08:28:25PM -0700, 'William J. Bowman' via Racket Users 
wrote:
> I've confirmed it's definitely client side, by redirecting the handin 
> server's address to 127.0.0.1 in /etc/hosts, and listening with `nc -l`. The 
> handin client hangs on "Making secure connection ..." and nc display nothing 
> at all. A few restarts and `nc -l` displays a bunch of gibberish that I'm 
> guessing is the handin protocol, and killing `nc` triggers the handin client 
> to report a connection error.
> 
> So it's:
> - handin client side
> - maybe related to openssl
> - nondeterministic
> - when it occurs, it will recur until you restart DrRacket
> - when it doesn't occur, it will not recur until you restart DrRacket
> - affects 8.1 BC
> - affects 8.1 CS
> - affects 8.2.0.2 CS 
> - results in the client failing send anything to the network
> 
> --
> William J. Bowman
> 
> On Sat, Sep 18, 2021 at 08:05:10PM -0700, 'William J. Bowman' via Racket 
> Users wrote:
> > Since I'm currently experiencing the issue, I've been able to get some 
> > better data. I've managed to reproduce it in 8.2.0.2 CS, which suggests 
> > it's not https://github.com/racket/racket/issues/3804.
> > 
> > Restarting twice DrRacket hasn't helped, nor has resetting my wifi 
> > connection.
> > 
> > After connecting via a browser, I notice a lot of the following in the log 
> > that seem to correlate with my attempts in the browser:
> > > [-|2021-09-18T19:37:45] handin: unknown protocol: #"GET / HTTP/1.1"
> > > ...
> > > [-|2021-09-18T19:37:53] ERROR: ssl-accept/enable-break: accept failed 
> > > (error:1408F09C:SSL routines:ssl3_get_record:http request)
> > 
> > As expected, nothing seem to correlate with my attempts to connect from the 
> > handin plugin.
> > 
> > This makes me suspect the server, but I can't reconcile that with why 
> > there's nothing in the logs.
> > 
> > --
> > William J. Bowman
> > 
> > On Sat, Sep 18, 2021 at 06:59:43PM -0700, 'William J. Bowman' via Racket 
> > Users wrote:
> > > I just tried this, but I can't seem to connect.
> > >   http://cs110.students.cs.ubc.ca:7979/
> > > gives "connection reset", and 
> > >   https://cs110.students.cs.ubc.ca:7979/
> > > gives "secure connection failed".
> > > 
> > > There's no prompt to accept the certificate (which I wouldn't expect, 
> > > because we're using a CA signed certificate through Let's Encrypt, not a 
> > > self-signed certificate).
> > > 
> > > I'm currently experiencing the problem on my own client. I'm not sure if 
> > > that's related; I also couldn't connect from my phone.
> > > 
> > > --
> > > William J. Bowman
> > > 
> > > On Sat, Sep 18, 2021 at 09:24:05PM -0400, Sam Tobin-Hochstadt wrote:
> > > > Have you tried visiting the server with a browser? That should work,
> > > > although you'l

Re: [racket-users] what is the limit of 2htdp/image and 2htdp/universe in terms of making games? i dont plan to make anything too huge but i do want to teach spritesheet animation for some pixel art

2021-09-19 Thread Stephen De Gabrielle
Hi

There are some resources at
https://github.com/racket/racket/wiki/Game-Development

You might be in particular interested in the
Support code for RacketCon 2019 Game Jam tutorial:

https://github.com/jeapostrophe/gamejam-2019/blob/master/world.rkt

(2htdp/universe)

I didn’t attend the tutorial so I don’t have any other details

S.


On Sun, 19 Sep 2021 at 08:49, jest array  wrote:

> I want to teach making a few classic arcade hits like pong, space
> invaders, flappy birds, etc, maybe lastly one that involves pixel art
> spritesheet animation and I'm just curious if 2htdp/universe can handle it.
> Can anyone send me some 2htdp/universe games so I can test a few?
> Anyone got any perf tips for when it can't? I suppose moving up a language
> level will provide some perf?
>
> --
> 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/5db8de9d-dac4-48ef-be46-8bd44395c870n%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/5db8de9d-dac4-48ef-be46-8bd44395c870n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
-- 


-- 
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/CAGHj7-KpvC%3DKWek1w8-N91RqUEG59rWpwJtO9KD21KKSnpvM2w%40mail.gmail.com.


[racket-users] what is the limit of 2htdp/image and 2htdp/universe in terms of making games? i dont plan to make anything too huge but i do want to teach spritesheet animation for some pixel art

2021-09-19 Thread jest array
I want to teach making a few classic arcade hits like pong, space invaders, 
flappy birds, etc, maybe lastly one that involves pixel art spritesheet 
animation and I'm just curious if 2htdp/universe can handle it.
Can anyone send me some 2htdp/universe games so I can test a few?
Anyone got any perf tips for when it can't? I suppose moving up a language 
level will provide some perf? 

-- 
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/5db8de9d-dac4-48ef-be46-8bd44395c870n%40googlegroups.com.


Re: [racket-users] Help debugging handin client connection problem

2021-09-18 Thread 'William J. Bowman' via Racket Users
I've confirmed it's definitely client side, by redirecting the handin server's 
address to 127.0.0.1 in /etc/hosts, and listening with `nc -l`. The handin 
client hangs on "Making secure connection ..." and nc display nothing at all. A 
few restarts and `nc -l` displays a bunch of gibberish that I'm guessing is the 
handin protocol, and killing `nc` triggers the handin client to report a 
connection error.

So it's:
- handin client side
- maybe related to openssl
- nondeterministic
- when it occurs, it will recur until you restart DrRacket
- when it doesn't occur, it will not recur until you restart DrRacket
- affects 8.1 BC
- affects 8.1 CS
- affects 8.2.0.2 CS 
- results in the client failing send anything to the network

--
William J. Bowman

On Sat, Sep 18, 2021 at 08:05:10PM -0700, 'William J. Bowman' via Racket Users 
wrote:
> Since I'm currently experiencing the issue, I've been able to get some better 
> data. I've managed to reproduce it in 8.2.0.2 CS, which suggests it's not 
> https://github.com/racket/racket/issues/3804.
> 
> Restarting twice DrRacket hasn't helped, nor has resetting my wifi connection.
> 
> After connecting via a browser, I notice a lot of the following in the log 
> that seem to correlate with my attempts in the browser:
> > [-|2021-09-18T19:37:45] handin: unknown protocol: #"GET / HTTP/1.1"
> > ...
> > [-|2021-09-18T19:37:53] ERROR: ssl-accept/enable-break: accept failed 
> > (error:1408F09C:SSL routines:ssl3_get_record:http request)
> 
> As expected, nothing seem to correlate with my attempts to connect from the 
> handin plugin.
> 
> This makes me suspect the server, but I can't reconcile that with why there's 
> nothing in the logs.
> 
> --
> William J. Bowman
> 
> On Sat, Sep 18, 2021 at 06:59:43PM -0700, 'William J. Bowman' via Racket 
> Users wrote:
> > I just tried this, but I can't seem to connect.
> >   http://cs110.students.cs.ubc.ca:7979/
> > gives "connection reset", and 
> >   https://cs110.students.cs.ubc.ca:7979/
> > gives "secure connection failed".
> > 
> > There's no prompt to accept the certificate (which I wouldn't expect, 
> > because we're using a CA signed certificate through Let's Encrypt, not a 
> > self-signed certificate).
> > 
> > I'm currently experiencing the problem on my own client. I'm not sure if 
> > that's related; I also couldn't connect from my phone.
> > 
> > --
> > William J. Bowman
> > 
> > On Sat, Sep 18, 2021 at 09:24:05PM -0400, Sam Tobin-Hochstadt wrote:
> > > Have you tried visiting the server with a browser? That should work,
> > > although you'll have to accept the certificate. It might also indicate 
> > > some
> > > aspect of the behavior.
> > > 
> > > Sam
> > > 
> > > On Sat, Sep 18, 2021, 7:13 PM 'William J. Bowman' via Racket Users <
> > > racket-users@googlegroups.com> wrote:
> > > 
> > > > I need some help debugging an issue with the handin package. The handin
> > > > plugin (client) displays “Making secure connection to  
> > > > …”,
> > > > and simply hangs. Closing the dialog and trying again never resolves the
> > > > issue.
> > > >
> > > > The only method that seems to resolve the issue, although 
> > > > inconsistently,
> > > > is restarting DrRacket, opening a new file, and trying to submit that 
> > > > new
> > > > file. This sometimes, but not always, enables the client to connect. 
> > > > Once
> > > > it does connect, the issue doesn't seem to recur for some time. The 
> > > > client
> > > > can make multiple successful submissions, at least until the end of 
> > > > lecture
> > > > (maybe related to the next time they disconnect/reconnect to the 
> > > > internet).
> > > >
> > > > We running Racket 7.8 on the server and 8.1 BC on the clients. We've 
> > > > seen
> > > > the issue occur on many operating system---old and new versions of 
> > > > macOS,
> > > > Windows 10, and at one report on Linux.
> > > >
> > > > I can't just upgrade the clients to 8.2, since there's a bug in 8.2 that
> > > > affects rendering inexact numbers in BSL, so I really want some 
> > > > confidence
> > > > about what the issue is before I start upgrading versions.
> > > >
> > > > Anecdotally, the problem seems more common this semester compared to the
> > > > previous semester, and we upgraded the clients to 8.1 this semester,
> > &

Re: [racket-users] Help debugging handin client connection problem

2021-09-18 Thread 'William J. Bowman' via Racket Users
Since I'm currently experiencing the issue, I've been able to get some better 
data. I've managed to reproduce it in 8.2.0.2 CS, which suggests it's not 
https://github.com/racket/racket/issues/3804.

Restarting twice DrRacket hasn't helped, nor has resetting my wifi connection.

After connecting via a browser, I notice a lot of the following in the log that 
seem to correlate with my attempts in the browser:
> [-|2021-09-18T19:37:45] handin: unknown protocol: #"GET / HTTP/1.1"
> ...
> [-|2021-09-18T19:37:53] ERROR: ssl-accept/enable-break: accept failed 
> (error:1408F09C:SSL routines:ssl3_get_record:http request)

As expected, nothing seem to correlate with my attempts to connect from the 
handin plugin.

This makes me suspect the server, but I can't reconcile that with why there's 
nothing in the logs.

--
William J. Bowman

On Sat, Sep 18, 2021 at 06:59:43PM -0700, 'William J. Bowman' via Racket Users 
wrote:
> I just tried this, but I can't seem to connect.
>   http://cs110.students.cs.ubc.ca:7979/
> gives "connection reset", and 
>   https://cs110.students.cs.ubc.ca:7979/
> gives "secure connection failed".
> 
> There's no prompt to accept the certificate (which I wouldn't expect, because 
> we're using a CA signed certificate through Let's Encrypt, not a self-signed 
> certificate).
> 
> I'm currently experiencing the problem on my own client. I'm not sure if 
> that's related; I also couldn't connect from my phone.
> 
> --
> William J. Bowman
> 
> On Sat, Sep 18, 2021 at 09:24:05PM -0400, Sam Tobin-Hochstadt wrote:
> > Have you tried visiting the server with a browser? That should work,
> > although you'll have to accept the certificate. It might also indicate some
> > aspect of the behavior.
> > 
> > Sam
> > 
> > On Sat, Sep 18, 2021, 7:13 PM 'William J. Bowman' via Racket Users <
> > racket-users@googlegroups.com> wrote:
> > 
> > > I need some help debugging an issue with the handin package. The handin
> > > plugin (client) displays “Making secure connection to  …”,
> > > and simply hangs. Closing the dialog and trying again never resolves the
> > > issue.
> > >
> > > The only method that seems to resolve the issue, although inconsistently,
> > > is restarting DrRacket, opening a new file, and trying to submit that new
> > > file. This sometimes, but not always, enables the client to connect. Once
> > > it does connect, the issue doesn't seem to recur for some time. The client
> > > can make multiple successful submissions, at least until the end of 
> > > lecture
> > > (maybe related to the next time they disconnect/reconnect to the 
> > > internet).
> > >
> > > We running Racket 7.8 on the server and 8.1 BC on the clients. We've seen
> > > the issue occur on many operating system---old and new versions of macOS,
> > > Windows 10, and at one report on Linux.
> > >
> > > I can't just upgrade the clients to 8.2, since there's a bug in 8.2 that
> > > affects rendering inexact numbers in BSL, so I really want some confidence
> > > about what the issue is before I start upgrading versions.
> > >
> > > Anecdotally, the problem seems more common this semester compared to the
> > > previous semester, and we upgraded the clients to 8.1 this semester,
> > > suggesting the clients are at fault.
> > >
> > > When this problem occurs, there is nothing in the log on the handin
> > > server, suggesting the client did not even manage to initiate the
> > > connection to the server. In particular, the server never seems to make it
> > > to this log line:
> > >
> > > https://github.com/racket/handin/blob/ac08937cc6b1eca8abe3d4d4df59876f95cbea17/handin-server/main.rkt#L679
> > > This is one the earliest log lines and before pretty much anything
> > > happens, so we're *PRETTY SURE* the client is blocking.
> > >
> > > Right now, my best guess is that we might be affected by this bug, which
> > > causes SSL ports to block incorrectly:
> > >   https://github.com/racket/racket/issues/3804
> > >
> > > If so, it would probably be in the client, unless `(ssl-addresses r)` can
> > > block in the same way on the server, since otherwise the above log line
> > > would execute.
> > >
> > > However, if it is the client, I don't have any explanation about why
> > > restarting DrRacket would workaround the bug, or why it sometimes doesn't
> > > work.
> > >
> > > I'd appreciate any help.
> > >
> > > --
> > > William J. Bo

Re: [racket-users] Help debugging handin client connection problem

2021-09-18 Thread 'William J. Bowman' via Racket Users
I just tried this, but I can't seem to connect.
  http://cs110.students.cs.ubc.ca:7979/
gives "connection reset", and 
  https://cs110.students.cs.ubc.ca:7979/
gives "secure connection failed".

There's no prompt to accept the certificate (which I wouldn't expect, because 
we're using a CA signed certificate through Let's Encrypt, not a self-signed 
certificate).

I'm currently experiencing the problem on my own client. I'm not sure if that's 
related; I also couldn't connect from my phone.

--
William J. Bowman

On Sat, Sep 18, 2021 at 09:24:05PM -0400, Sam Tobin-Hochstadt wrote:
> Have you tried visiting the server with a browser? That should work,
> although you'll have to accept the certificate. It might also indicate some
> aspect of the behavior.
> 
> Sam
> 
> On Sat, Sep 18, 2021, 7:13 PM 'William J. Bowman' via Racket Users <
> racket-users@googlegroups.com> wrote:
> 
> > I need some help debugging an issue with the handin package. The handin
> > plugin (client) displays “Making secure connection to  …”,
> > and simply hangs. Closing the dialog and trying again never resolves the
> > issue.
> >
> > The only method that seems to resolve the issue, although inconsistently,
> > is restarting DrRacket, opening a new file, and trying to submit that new
> > file. This sometimes, but not always, enables the client to connect. Once
> > it does connect, the issue doesn't seem to recur for some time. The client
> > can make multiple successful submissions, at least until the end of lecture
> > (maybe related to the next time they disconnect/reconnect to the internet).
> >
> > We running Racket 7.8 on the server and 8.1 BC on the clients. We've seen
> > the issue occur on many operating system---old and new versions of macOS,
> > Windows 10, and at one report on Linux.
> >
> > I can't just upgrade the clients to 8.2, since there's a bug in 8.2 that
> > affects rendering inexact numbers in BSL, so I really want some confidence
> > about what the issue is before I start upgrading versions.
> >
> > Anecdotally, the problem seems more common this semester compared to the
> > previous semester, and we upgraded the clients to 8.1 this semester,
> > suggesting the clients are at fault.
> >
> > When this problem occurs, there is nothing in the log on the handin
> > server, suggesting the client did not even manage to initiate the
> > connection to the server. In particular, the server never seems to make it
> > to this log line:
> >
> > https://github.com/racket/handin/blob/ac08937cc6b1eca8abe3d4d4df59876f95cbea17/handin-server/main.rkt#L679
> > This is one the earliest log lines and before pretty much anything
> > happens, so we're *PRETTY SURE* the client is blocking.
> >
> > Right now, my best guess is that we might be affected by this bug, which
> > causes SSL ports to block incorrectly:
> >   https://github.com/racket/racket/issues/3804
> >
> > If so, it would probably be in the client, unless `(ssl-addresses r)` can
> > block in the same way on the server, since otherwise the above log line
> > would execute.
> >
> > However, if it is the client, I don't have any explanation about why
> > restarting DrRacket would workaround the bug, or why it sometimes doesn't
> > work.
> >
> > I'd appreciate any help.
> >
> > --
> > William J. Bowman
> >
> > --
> > 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/YUZyWlsY9CdCDyPu%40williamjbowman.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/YUaZj9v0Lch0jfMC%40williamjbowman.com.


[racket-users] Help debugging handin client connection problem

2021-09-18 Thread 'William J. Bowman' via Racket Users
I need some help debugging an issue with the handin package. The handin plugin 
(client) displays “Making secure connection to  …”, and simply 
hangs. Closing the dialog and trying again never resolves the issue.

The only method that seems to resolve the issue, although inconsistently, is 
restarting DrRacket, opening a new file, and trying to submit that new file. 
This sometimes, but not always, enables the client to connect. Once it does 
connect, the issue doesn't seem to recur for some time. The client can make 
multiple successful submissions, at least until the end of lecture (maybe 
related to the next time they disconnect/reconnect to the internet).

We running Racket 7.8 on the server and 8.1 BC on the clients. We've seen the 
issue occur on many operating system---old and new versions of macOS, Windows 
10, and at one report on Linux.

I can't just upgrade the clients to 8.2, since there's a bug in 8.2 that 
affects rendering inexact numbers in BSL, so I really want some confidence 
about what the issue is before I start upgrading versions.

Anecdotally, the problem seems more common this semester compared to the 
previous semester, and we upgraded the clients to 8.1 this semester, suggesting 
the clients are at fault.

When this problem occurs, there is nothing in the log on the handin server, 
suggesting the client did not even manage to initiate the connection to the 
server. In particular, the server never seems to make it to this log line:
  
https://github.com/racket/handin/blob/ac08937cc6b1eca8abe3d4d4df59876f95cbea17/handin-server/main.rkt#L679
This is one the earliest log lines and before pretty much anything happens, so 
we're *PRETTY SURE* the client is blocking.

Right now, my best guess is that we might be affected by this bug, which causes 
SSL ports to block incorrectly:
  https://github.com/racket/racket/issues/3804

If so, it would probably be in the client, unless `(ssl-addresses r)` can block 
in the same way on the server, since otherwise the above log line would execute.

However, if it is the client, I don't have any explanation about why restarting 
DrRacket would workaround the bug, or why it sometimes doesn't work.

I'd appreciate any help.

-- 
William J. Bowman

-- 
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/YUZyWlsY9CdCDyPu%40williamjbowman.com.


Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-18 Thread Dimaugh Silvestris
ail.com wrote:

> 2) (card (line . xs)) has only one field, xs. Of course, you could also 
>> define it as a normal field which contains a list, but there's some other 
>> scenarios where I found it more elegant to represent it as a dotted 
>> argument (like representing s-expressions as a struct).
>>
> Oh sorry, that was a typo. I meant currently you expect
>
> > (card (line . xs))
> > (line 1 2 3 4 5 6 7 8 9)
> (line 1 2 3 4 5 6 7 8 9)
>
> to be the output, but I was asking if:
>
> > (card (line . xs))
> > (line 1 2 3 4 5 6 7 8 9)
> (line '(1 2 3 4 5 6 7 8 9))
>
> makes more sense. In any case, your response clears things up that there 
> is indeed only one field. You simply want it to be printed like that.
>
> This is actually a pretty fun problem. Here’s a quick prototype. Dropping 
> it here in case anyone is interested:
>
> #lang racket
>
> (require syntax/parse/define
>  (for-syntax syntax/parse/lib/function-header
>  racket/syntax
>  racket/list
>  racket/struct-info))
>
> (begin-for-syntax
>   (struct my-struct-info (fields args ctor)
> #:property prop:procedure
> (λ (inst stx)
>   (syntax-parse stx
> [(_ args ...) #`(#,(my-struct-info-ctor inst) args ...)]
> [x:id #'#,(my-struct-info-ctor inst)]
>
> (define-syntax-parse-rule (define-accessors+predicate
> {~var struct-id (static values #f)}
> name:id)
>   #:with (fields ...) (struct-field-info-list (attribute struct-id.value))
>   #:do [(define the-struct-info (extract-struct-info (attribute 
> struct-id.value)))]
>   #:with predicate (list-ref the-struct-info 2)
>   #:with (accessors ...) (list-ref the-struct-info 3)
>   #:with new-predicate (format-id #'name "~a?" #'name)
>   #:with (new-accessors ...)
>   (map (λ (id) (format-id #'name "~a-~a" #'name id)) (attribute fields))
>
>   (begin
> (define new-predicate predicate)
> (define new-accessors accessors) ...))
>
> (define-syntax-parse-rule
>   (card
>{~optional (~var super-id (static my-struct-info? "card type"))}
>{~and header:function-header (_:id . args)})
>
>   #:with ((all-fields ...) all-args)
>   (let ([info (attribute super-id.value)])
> (cond
>   [info
>(unless (list? (syntax-e (my-struct-info-args info)))
>  (raise-syntax-error 'card
>  "supertype can't have variadic fields"
>  this-syntax))
>#`(({~@ . #,(my-struct-info-fields info)} . header.params)
>   ({~@ . #,(my-struct-info-args info)} . args))]
>   [else #'(header.params args)]))
>
>   #:fail-when (check-duplicates (attribute all-fields) #:key syntax-e)
>   "duplicate field name"
>
>   (begin
> (struct shadow (all-fields ...)
>   #:transparent
>   ;; TODO: implement gen:custom-write (probably with 
> make-constructor-style-printer)
>   ;; to customize struct value printing
>   #:reflection-name 'header.name)
> (define-accessors+predicate shadow header.name)
> (define (shadow-ctor . all-args)
>   (shadow all-fields ...))
> (define-syntax header.name
>   (my-struct-info #'(all-fields ...)
>   #'all-args
>   #'shadow-ctor
>
> (let ()
>   (card (hola a b #:c c))
>   (println (hola 1 2 #:c 3))
>
>   (card (ciao a [b 3]))
>   (println (ciao 7))
>   (println (ciao 7 4))
>
>   (card (line . xs))
>   (println (line 1 2 3 4 5 6 7 8 9)))
>
> (let ()
>   (card (hola a #:b b))
>   (card hola (ciao c))
>   (define v (ciao 1 #:b 2 3))
>   (println v)
>   (println (list (ciao-a v) (ciao-b v) (ciao-c v)))
>   (println (list (ciao? v) (hola? v
>
> (let ()
>   (card (foo . xs))
>   ;; uncomment should result in a syntax error
>   (card #;foo (bar . ys))
>
>   (card (a xs))
>   ;; uncomment should result in a syntax error
>   (card #;a (b xs))
>
>   (void))
>
> What I did not implement is making the struct value printed in the way you 
> want, but that can be adjusted by using gen:custom-write. Note that I 
> didn’t (re)use struct‘s supertype feature since you want fields in the 
> opposite order.
>
>

-- 
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/0a94926b-5a19-46e9-b7ea-92b8c83f16fan%40googlegroups.com.


Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread Sorawee Porncharoenwase
>
> 2) (card (line . xs)) has only one field, xs. Of course, you could also
> define it as a normal field which contains a list, but there's some other
> scenarios where I found it more elegant to represent it as a dotted
> argument (like representing s-expressions as a struct).
>
Oh sorry, that was a typo. I meant currently you expect

> (card (line . xs))
> (line 1 2 3 4 5 6 7 8 9)
(line 1 2 3 4 5 6 7 8 9)

to be the output, but I was asking if:

> (card (line . xs))
> (line 1 2 3 4 5 6 7 8 9)
(line '(1 2 3 4 5 6 7 8 9))

makes more sense. In any case, your response clears things up that there is
indeed only one field. You simply want it to be printed like that.

This is actually a pretty fun problem. Here’s a quick prototype. Dropping
it here in case anyone is interested:

#lang racket

(require syntax/parse/define
 (for-syntax syntax/parse/lib/function-header
 racket/syntax
 racket/list
 racket/struct-info))

(begin-for-syntax
  (struct my-struct-info (fields args ctor)
#:property prop:procedure
(λ (inst stx)
  (syntax-parse stx
[(_ args ...) #`(#,(my-struct-info-ctor inst) args ...)]
[x:id #'#,(my-struct-info-ctor inst)]

(define-syntax-parse-rule (define-accessors+predicate
{~var struct-id (static values #f)}
name:id)
  #:with (fields ...) (struct-field-info-list (attribute struct-id.value))
  #:do [(define the-struct-info (extract-struct-info (attribute
struct-id.value)))]
  #:with predicate (list-ref the-struct-info 2)
  #:with (accessors ...) (list-ref the-struct-info 3)
  #:with new-predicate (format-id #'name "~a?" #'name)
  #:with (new-accessors ...)
  (map (λ (id) (format-id #'name "~a-~a" #'name id)) (attribute fields))

  (begin
(define new-predicate predicate)
(define new-accessors accessors) ...))

(define-syntax-parse-rule
  (card
   {~optional (~var super-id (static my-struct-info? "card type"))}
   {~and header:function-header (_:id . args)})

  #:with ((all-fields ...) all-args)
  (let ([info (attribute super-id.value)])
(cond
  [info
   (unless (list? (syntax-e (my-struct-info-args info)))
 (raise-syntax-error 'card
 "supertype can't have variadic fields"
 this-syntax))
   #`(({~@ . #,(my-struct-info-fields info)} . header.params)
  ({~@ . #,(my-struct-info-args info)} . args))]
  [else #'(header.params args)]))

  #:fail-when (check-duplicates (attribute all-fields) #:key syntax-e)
  "duplicate field name"

  (begin
(struct shadow (all-fields ...)
  #:transparent
  ;; TODO: implement gen:custom-write (probably with
make-constructor-style-printer)
  ;; to customize struct value printing
  #:reflection-name 'header.name)
(define-accessors+predicate shadow header.name)
(define (shadow-ctor . all-args)
  (shadow all-fields ...))
(define-syntax header.name
  (my-struct-info #'(all-fields ...)
  #'all-args
  #'shadow-ctor

(let ()
  (card (hola a b #:c c))
  (println (hola 1 2 #:c 3))

  (card (ciao a [b 3]))
  (println (ciao 7))
  (println (ciao 7 4))

  (card (line . xs))
  (println (line 1 2 3 4 5 6 7 8 9)))

(let ()
  (card (hola a #:b b))
  (card hola (ciao c))
  (define v (ciao 1 #:b 2 3))
  (println v)
  (println (list (ciao-a v) (ciao-b v) (ciao-c v)))
  (println (list (ciao? v) (hola? v

(let ()
  (card (foo . xs))
  ;; uncomment should result in a syntax error
  (card #;foo (bar . ys))

  (card (a xs))
  ;; uncomment should result in a syntax error
  (card #;a (b xs))

  (void))

What I did not implement is making the struct value printed in the way you
want, but that can be adjusted by using gen:custom-write. Note that I
didn’t (re)use struct‘s supertype feature since you want fields in the
opposite order.

-- 
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/CADcuegvDpWqFACR1CQ9Z48GQdvpgkpk2pJTVBzj-t3zojr9nkg%40mail.gmail.com.


Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread Dimaugh Silvestris
Thanks, I'll take a look into the code struct++! I'll probably get lost but
I'm sure I'll learn something.
Answering your questions:

A)  What exactly are you trying to do, because I think I've got it but I'm
>>> still fuzzy.
>>>
>>
Structs that allow constructors like any other function, and which are
printed back as the function which creates them. So, a bit like prefab
structs but with default values, keywords and (f . xs) args.

B)  Why are you trying to do it?
>>>
>>
This one is long, but I think they're cool. Also convenient in several
scenarios, like representing a DSP graph where things like keyword
arguments often come in handy. I've been replicating this behavior by hand,
it was time to write a macro.


> C) Is there a simpler / more Racket-ish way to do it?
>>>
>>
Probably, but I'm very picky and I thought Racket was good for this kind of
thing.

I notice that you're using make-struct-type instead of struct -- is that
>>> intentional or is there some specific feature you want?  I suspect I'm
>>> about to get a more experienced person telling me that I've missed
>>> something, but to the best of my knowledge struct is the more modern
>>> version and can do everything that make-struct-type can do but cleaner.
>>>
>>>
Struct is a macro built on top of make-struct-type, with higher level
features. However, I'm trying to get different features so I have to
descend into the lower level.


> As to the printing as a constructor call:  putting the #:prefab option on
>>> a struct will allow you to print it in a reversible form that can be called
>>> in order to generate the struct again, but it makes explicit all the values
>>> that go in instead of hiding them away as defaults or etc.  For example:
>>>
>>
Yes,  prefabs come painfully close to what I'm trying to do, but they still
don't allow you to define the constructor however you like (for instance,
using keyword arguments). So instead of doing (card (hola a b #:c [c 3])),
I end up writing things like:

(struct CARD (a b c)
.)   ;;; give it a custom-write-printer so that it
prints as 'card' and c is preceeded by #:c, which is long
(define (card a b #:c [c 3]) ...)
(define (card-a x) (CARD-a x))
...

And then I get fed up and I think, well this is what macros were made for,
right?

How are you going to handle the situation where a parent and child struct
>>> have a field with the same name?  This is entirely legit:
>>>
>>> #lang racket
>>>
>>> (struct person (name age) #:prefab) ; age is years since birth
>>>
>>> (struct employee person (age) #:prefab) ; age is years since hiring
>>>
>>>
>>> (define bob (employee 'bob 17 3))
>>> bob
>>> (employee-age bob)
>>> (person-age bob)
>>>
>>> Output:
>>>
>>> '#s((employee person 2) bob 17 3)
>>> 3
>>> 17
>>>
>>
It wouldn't be allowed, and I consider it a bad naming choice. But at the
lower level make-struct-type, fields have no names, there's just a number
of them. Make-struct-type returns, among other things, a struct accessor
that works like vector ref: (mystruct-accessor mystruct n) to get the nth
field. Struct is just a macro on top of make-struct-type that creates a
custom accessor for each field.


>>> Going back to the earlier question:  What is it you are ultimately
>>> trying to accomplish at a high level?  i.e. Not "generate a lot of struct
>>> types and field data" but something like "store information about a
>>> hierarchical structure of  in a persistent way so that it is
>>> recoverable across server restarts."
>>>
>>
Too often I find myself replicating this behavior, in a few things I'm
working on: one is a SuperCollider client, another is a drawing library
based on racket/draw, but representing things very differently, and also
some stuff with html where I didn't want to work with quasiquote and
unquote everywhere.

-- 
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/CAN4YmRG_dD0RfxKATh6U%3DyVT5UX%3De5GnuVbfkGDfJDRdqV44pg%40mail.gmail.com.


Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread Dimaugh Silvestris
18
>>
>> (with-input-from-file
>>   "/tmp/struct-demo"
>>   (thunk (read)))
>>
>> (with-input-from-file
>>   "/tmp/struct-demo"
>>   (thunk (person-name (read
>>
>>
>>
>> Output:
>>
>> '#s(person bob 17)
>> '#s(person fred 18)
>> 'fred
>>
>> Obviously, reading code directly from a file is a bad plan, but the same
>> would work from any appropriate port and I'm using a file because it's
>> easy.  The point is that I was able to write it into a port (in this case a
>> file port) such that it produced a format that represented the constructor
>> call and then read it back into an actual struct that I could use accessors
>> on etc.  One disadvantage is that you can't attach properties to a prefab
>> struct but that might or might not be relevant to you.
>>
>>
>> > (card (hola a b #:c c))
>>>> > (hola 1 2 #:c 3)
>>>> (hola 1 2 #:c 3)
>>>> or
>>>> > (card (ciao a [b 3]))
>>>> > (ciao 7)
>>>> (ciao 7)
>>>> > (ciao 7 4)
>>>> (ciao 7 4)
>>>>
>>>> or even
>>>>
>>>> > (card (line . xs))
>>>> > (line 1 2 3 4 5 6 7 8 9)
>>>> (line 1 2 3 4 5 6 7 8 9)
>>>>
>>>> Also the names of the fields are stored in *-fields
>>>> (this is the abc-foo of the above example), so *hola-fields contains '(a b
>>>> #:c c).
>>>> So far this is working perfectly, but I don't have inheritance. So when
>>>> I create a card that inherits from a previous card, I need to access its
>>>> *-fields to define a new function containing both the parent
>>>> and the son fields. That is, I'm trying to get this behavior:
>>>> > (card (hola a #:b b))
>>>> > (card hola (ciao c))  ;;; should expand to (define (ciao a #:b b c)
>>>> ...), among other things
>>>> > (ciao 1 #:b 2 3)
>>>> (ciao 1 #:b 2 3)
>>>>
>>>
>> How are you going to handle the situation where a parent and child struct
>> have a field with the same name?  This is entirely legit:
>>
>> #lang racket
>>
>> (struct person (name age) #:prefab) ; age is years since birth
>>
>> (struct employee person (age) #:prefab) ; age is years since hiring
>>
>>
>> (define bob (employee 'bob 17 3))
>> bob
>> (employee-age bob)
>> (person-age bob)
>>
>> Output:
>>
>> '#s((employee person 2) bob 17 3)
>> 3
>> 17
>>
>>
>> Going back to the earlier question:  What is it you are ultimately trying
>> to accomplish at a high level?  i.e. Not "generate a lot of struct types
>> and field data" but something like "store information about a hierarchical
>> structure of  in a persistent way so that it is recoverable across
>> server restarts."
>>
>>
>>
>>>> On Thu, 16 Sept 2021 at 22:35, Sorawee Porncharoenwase <
>>>> sorawee.pw...@gmail.com> wrote:
>>>>
>>>>> In general, it would be helpful to provide an example of the macro
>>>>> use, so that we know what you want to do. If it doesn't work, it would be
>>>>> helpful to provide the buggy program and an error message so that we can
>>>>> help with the issue that you are encountering.
>>>>>
>>>>> From my guess, you have a variable named abc-foo somewhere, and with
>>>>> this macro, you wish to define a function named abc that can access
>>>>> the value of abc-foo? If so, here’s an example of a working program:
>>>>>
>>>>> #lang racket
>>>>>
>>>>> (require (for-syntax racket/syntax))
>>>>>
>>>>> (define-syntax (my-macro stx)
>>>>>   (syntax-case stx ()
>>>>> [(_ name other-args ...)
>>>>>      (with-syntax ([varname (format-id #'name "~a-foo" #'name)])
>>>>>#'(define name
>>>>>    (λ (other-args ...)
>>>>>  (println (list varname other-args ...)]))
>>>>>
>>>>> (define abc-foo 123)
>>>>> (my-macro abc x y)
>>>>> (abc 5 6) ;=> '(123 5 6)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Sep 16, 2021 at 1:21 PM Dimaugh Silvestris <
>>>>> dimaughsilvest...@gmail.com> wrote:
>>

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread David Storrs
xpand to (define (ciao a #:b b c)
>>> ...), among other things
>>> > (ciao 1 #:b 2 3)
>>> (ciao 1 #:b 2 3)
>>>
>>
> How are you going to handle the situation where a parent and child struct
> have a field with the same name?  This is entirely legit:
>
> #lang racket
>
> (struct person (name age) #:prefab) ; age is years since birth
>
> (struct employee person (age) #:prefab) ; age is years since hiring
>
>
> (define bob (employee 'bob 17 3))
> bob
> (employee-age bob)
> (person-age bob)
>
> Output:
>
> '#s((employee person 2) bob 17 3)
> 3
> 17
>
>
> Going back to the earlier question:  What is it you are ultimately trying
> to accomplish at a high level?  i.e. Not "generate a lot of struct types
> and field data" but something like "store information about a hierarchical
> structure of  in a persistent way so that it is recoverable across
> server restarts."
>
>
>
>>> On Thu, 16 Sept 2021 at 22:35, Sorawee Porncharoenwase <
>>> sorawee.pw...@gmail.com> wrote:
>>>
>>>> In general, it would be helpful to provide an example of the macro use,
>>>> so that we know what you want to do. If it doesn't work, it would be
>>>> helpful to provide the buggy program and an error message so that we can
>>>> help with the issue that you are encountering.
>>>>
>>>> From my guess, you have a variable named abc-foo somewhere, and with
>>>> this macro, you wish to define a function named abc that can access
>>>> the value of abc-foo? If so, here’s an example of a working program:
>>>>
>>>> #lang racket
>>>>
>>>> (require (for-syntax racket/syntax))
>>>>
>>>> (define-syntax (my-macro stx)
>>>>   (syntax-case stx ()
>>>> [(_ name other-args ...)
>>>>  (with-syntax ([varname (format-id #'name "~a-foo" #'name)])
>>>>#'(define name
>>>>(λ (other-args ...)
>>>>  (println (list varname other-args ...)]))
>>>>
>>>> (define abc-foo 123)
>>>> (my-macro abc x y)
>>>> (abc 5 6) ;=> '(123 5 6)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Sep 16, 2021 at 1:21 PM Dimaugh Silvestris <
>>>> dimaughsilvest...@gmail.com> wrote:
>>>>
>>>>> (sorry if I'm asking too many questions about macros lately, I'm
>>>>> learning about them but I keep running into scenarios I can't find
>>>>> documentation for)
>>>>>
>>>>> I'm trying to capture the value of a variable whose identifier I can
>>>>> only get with format-id, inside a with-syntax.
>>>>> Something like this pseudocode (imagine name-foo contains a list of
>>>>> symbols):
>>>>> (define-syntax (my-macro stx)
>>>>>   (syntax-case stx ()
>>>>> ((_ name other-args ...)
>>>>>  (with-syntax* ((varname (format-id #'name "~a-foo" #'name))
>>>>> (varval (cons (datum->syntax #'varname)
>>>>> (datum->syntax #'(other-args ...)
>>>>>#'(define name (λ varval (print varval)))
>>>>>
>>>>>
>>>>> Which of course doesn't work. I understand this might have to do with
>>>>> how macros work at an earlier phase than runtime, so is it impossible?
>>>>>
>>>>> --
>>>>> 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/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/racket-users/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> --
>> 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/CADcuegvgnUpin2sMeg%3DPHRAN4gBRDx0HpUAuz8dM3aaZ8uAGvw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CADcuegvgnUpin2sMeg%3DPHRAN4gBRDx0HpUAuz8dM3aaZ8uAGvw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAE8gKofb%2BsRO3JJm667sv25jNKTkwLH6qpQu1gGKf7WydDUEfw%40mail.gmail.com.


Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread David Storrs
e helpful to provide an example of the macro use,
>>> so that we know what you want to do. If it doesn't work, it would be
>>> helpful to provide the buggy program and an error message so that we can
>>> help with the issue that you are encountering.
>>>
>>> From my guess, you have a variable named abc-foo somewhere, and with
>>> this macro, you wish to define a function named abc that can access the
>>> value of abc-foo? If so, here’s an example of a working program:
>>>
>>> #lang racket
>>>
>>> (require (for-syntax racket/syntax))
>>>
>>> (define-syntax (my-macro stx)
>>>   (syntax-case stx ()
>>> [(_ name other-args ...)
>>>  (with-syntax ([varname (format-id #'name "~a-foo" #'name)])
>>>#'(define name
>>>(λ (other-args ...)
>>>  (println (list varname other-args ...)]))
>>>
>>> (define abc-foo 123)
>>> (my-macro abc x y)
>>> (abc 5 6) ;=> '(123 5 6)
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Sep 16, 2021 at 1:21 PM Dimaugh Silvestris <
>>> dimaughsilvest...@gmail.com> wrote:
>>>
>>>> (sorry if I'm asking too many questions about macros lately, I'm
>>>> learning about them but I keep running into scenarios I can't find
>>>> documentation for)
>>>>
>>>> I'm trying to capture the value of a variable whose identifier I can
>>>> only get with format-id, inside a with-syntax.
>>>> Something like this pseudocode (imagine name-foo contains a list of
>>>> symbols):
>>>> (define-syntax (my-macro stx)
>>>>   (syntax-case stx ()
>>>> ((_ name other-args ...)
>>>>  (with-syntax* ((varname (format-id #'name "~a-foo" #'name))
>>>> (varval (cons (datum->syntax #'varname)
>>>> (datum->syntax #'(other-args ...)
>>>>#'(define name (λ varval (print varval)))
>>>>
>>>>
>>>> Which of course doesn't work. I understand this might have to do with
>>>> how macros work at an earlier phase than runtime, so is it impossible?
>>>>
>>>> --
>>>> 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/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/racket-users/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
> 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/CADcuegvgnUpin2sMeg%3DPHRAN4gBRDx0HpUAuz8dM3aaZ8uAGvw%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CADcuegvgnUpin2sMeg%3DPHRAN4gBRDx0HpUAuz8dM3aaZ8uAGvw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAE8gKodOQLq71Y362t_idZdoKJO9fkhK2EQB96_KXnOsT9rwBA%40mail.gmail.com.


Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread Sorawee Porncharoenwase
Instead of creating hola-fields which exists at run-time, you can
(define-syntax
hola ...) to a struct containing the field information at compile-time (it
probably needs to contain other information too). The struct could have
prop:procedure which in this case will be the syntax transformer that
generates struct creation. Looking up the field compile-time information
then can be done by using syntax-local-value or static syntax class. See
section 2.1 in https://www.cs.utah.edu/plt/publications/jfp12-draft-fcdf.pdf
for explanations.

What’s unclear to me are:

1) How would you deal with the following? Should it be an error?

(card (foo . xs))
(card foo (bar . ys))

2) How would you determine the number of fields (and field names) in the
following?

> (card (line . xs))
> (line 1 2 3 4 5 6 7 8 9)

Wouldn’t it make more sense to have:

> (card (line . xs))
> (line '(1 2 3 4 5 6 7 8 9))

where xs is the only field.

3) Shouldn’t the following result in (ciao 7 3)?

> (card (ciao a [b 3]))
> (ciao 7)



On Thu, Sep 16, 2021 at 2:12 PM Dimaugh Silvestris <
dimaughsilvest...@gmail.com> wrote:

> Sorry, I haven't posted the full macro because it's long and makes use of
> several other functions, but I'll try to summarize what it does:
>
> Short summary: I'm trying to have a macro (mymacro oldname newname (fields
> ...)) that accesses oldname-foo, which contains a list of symbols, and then
> define a function that takes (cons oldname-foo (fields ...)) formated as
> identifiers as arguments. Or at least to get the length of oldname-foo and
> name them whatever.
>
> Full explanation: using make-struct-type I'm building a different struct
> system I call cards, where structs can be defined as a function call, which
> will be their constructor, and they are printed as the constructor function
> call that would generate them. So, for instance, we can do:
> > (card (hola a b #:c c))
> > (hola 1 2 #:c 3)
> (hola 1 2 #:c 3)
> or
> > (card (ciao a [b 3]))
> > (ciao 7)
> (ciao 7)
> > (ciao 7 4)
> (ciao 7 4)
>
> or even
>
> > (card (line . xs))
> > (line 1 2 3 4 5 6 7 8 9)
> (line 1 2 3 4 5 6 7 8 9)
>
> Also the names of the fields are stored in *-fields
> (this is the abc-foo of the above example), so *hola-fields contains '(a b
> #:c c).
> So far this is working perfectly, but I don't have inheritance. So when I
> create a card that inherits from a previous card, I need to access its
> *-fields to define a new function containing both the parent
> and the son fields. That is, I'm trying to get this behavior:
> > (card (hola a #:b b))
> > (card hola (ciao c))  ;;; should expand to (define (ciao a #:b b c)
> ...), among other things
> > (ciao 1 #:b 2 3)
> (ciao 1 #:b 2 3)
>
> On Thu, 16 Sept 2021 at 22:35, Sorawee Porncharoenwase <
> sorawee.pw...@gmail.com> wrote:
>
>> In general, it would be helpful to provide an example of the macro use,
>> so that we know what you want to do. If it doesn't work, it would be
>> helpful to provide the buggy program and an error message so that we can
>> help with the issue that you are encountering.
>>
>> From my guess, you have a variable named abc-foo somewhere, and with
>> this macro, you wish to define a function named abc that can access the
>> value of abc-foo? If so, here’s an example of a working program:
>>
>> #lang racket
>>
>> (require (for-syntax racket/syntax))
>>
>> (define-syntax (my-macro stx)
>>   (syntax-case stx ()
>> [(_ name other-args ...)
>>  (with-syntax ([varname (format-id #'name "~a-foo" #'name)])
>>#'(define name
>>(λ (other-args ...)
>>  (println (list varname other-args ...)]))
>>
>> (define abc-foo 123)
>> (my-macro abc x y)
>> (abc 5 6) ;=> '(123 5 6)
>>
>>
>>
>>
>>
>> On Thu, Sep 16, 2021 at 1:21 PM Dimaugh Silvestris <
>> dimaughsilvest...@gmail.com> wrote:
>>
>>> (sorry if I'm asking too many questions about macros lately, I'm
>>> learning about them but I keep running into scenarios I can't find
>>> documentation for)
>>>
>>> I'm trying to capture the value of a variable whose identifier I can
>>> only get with format-id, inside a with-syntax.
>>> Something like this pseudocode (imagine name-foo contains a list of
>>> symbols):
>>> (define-syntax (my-macro stx)
>>>   (syntax-case stx ()
>>> ((_ name other-args ...)
>>>  (with-syntax* ((varname (format-id #'name "~a-foo" #'name))
>>>     (varval (cons (datum->syntax #'varname)
>>> (datum->

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-16 Thread David Storrs
Sorawee answered your immediate question, but I figured I'd offer a pointer
to Fear of Macros in case you haven't seen it:
https://www.greghendershott.com/fear-of-macros/  It helped me a lot when I
was trying to get my head around macros.  Also, I got a lot of value from
reading through the code of
https://pkgs.racket-lang.org/package/struct-update

On Thu, Sep 16, 2021 at 4:21 PM Dimaugh Silvestris <
dimaughsilvest...@gmail.com> wrote:

> (sorry if I'm asking too many questions about macros lately, I'm learning
> about them but I keep running into scenarios I can't find documentation for)
>
> I'm trying to capture the value of a variable whose identifier I can only
> get with format-id, inside a with-syntax.
> Something like this pseudocode (imagine name-foo contains a list of
> symbols):
> (define-syntax (my-macro stx)
>   (syntax-case stx ()
> ((_ name other-args ...)
>  (with-syntax* ((varname (format-id #'name "~a-foo" #'name))
> (varval (cons (datum->syntax #'varname) (datum->syntax
> #'(other-args ...)
>#'(define name (λ varval (print varval)))
>
>
> Which of course doesn't work. I understand this might have to do with how
> macros work at an earlier phase than runtime, so is it impossible?
>
> --
> 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/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAE8gKod53kD4ZFyxmatP4qx%2BvSKqrnT-if7PCD4MWxA7Tva3-Q%40mail.gmail.com.


[racket-users] É PEDOFILO ASSASSINO: #PAOLOBARRAI DI CRIMINALISSIMA #TERRABITCOIN! IL MALAVITOSO LEGHISTA #LUCASOSTEGNI, POI INCARCERATO, STAVA SCAPPANDO A PORTO SEGURO (BRASILE), DOVE IL KILLER PAOLO

2021-09-16 Thread 'LORENZO PIACENTINI LAZARD MILAN' via Racket Users
É PEDOFILO ASSASSINO: #PAOLOBARRAI DI CRIMINALISSIMA #TERRABITCOIN! IL 
MALAVITOSO LEGHISTA #LUCASOSTEGNI, POI INCARCERATO, STAVA SCAPPANDO A PORTO 
SEGURO (BRASILE), DOVE IL KILLER PAOLO BARRAI HA RICICLATO PARTE DEI 49 MLN 
€ RUBATI DA LEGA LADRONA!

RAPISCE, INCULA ED UCCIDE TANTI BAMBINI: PAOLO BARRAI (NOTO COME "IL 
PEDOFILO DEL BITCOIN, DI LEGA LADRONA, DI STRAGISTA SILVIO BERLUSCONI 
#SILVIOBERLUSCONI E DI NAZISTA MARINA BERLUSCONI #MARINABERLUSCONI ")! 
SEMPRE A "SPENNARE" ECONOMICAMENTE I POLLI DEL WEB! FALSO, LADRO, 
TRUFFATORE! AZZERA I TUOI RISPARMI! NON AZZECCA MAI PREVISIONI IN BORSA! É 
NAZISTA OMICIDA E RICICLA SOLDI STRA ASSASSINI DI NDRANGHETA, CAMORRA, 
MAFIA, SACRA CORONA UNITA E LEGA LADRONA (OLTRE CHE DI PEDOFILO ASSASSINO 
SILVIO BERLUSCONI)!

SALVE. SONO ANDREAS NIGG. VICE PRESIDENT DI BANCA SAFRA SARASIN DI ZURIGO. 
E VI VOGLIO DIRE CON TUTTE LE MIE FORZE CHE...

IL LEGHISTA PEDOFILO ED ASSASSINO PAOLO BARRAI (NATO A MILANO IL 
28.6.1965), IL LEGHISTA INCULA ED AMMAZZA BAMBINI PAOLO PIETRO BARRAI (NOTO 
IN TUTTO IL MONDO COME IL PEDOFILO DEL BITCOIN) E' DA ANNI INDAGATO DA 
PROCURA DI MILANO, PROCURA DI LUGANO, PROCURA DI ZUGO, SCOTLAND YARD 
LONDRA, FBI NEW YORK, POLICIA CIVIL DI PORTO SEGURO (BR).

É DAVVERO PEDERASTA ED OMICIDA: PAOLO BARRAI DI CRIMINALE TERRA BITCOIN (O 
CRIMINALE TERRABITCOIN CLUB)! IL LEGHISTA DELINQUENTE LUCA SOSTEGNI, 
ARRESTATO, SCAPPAVA IN CITATA PORTO SEGURO (BR), OSSIA, GUARDA CASO, DOVE 
IL KILLER NAZISTA PAOLO BARRAI HA RICICLATO PARTE DEI 49 MLN € RUBATI DA 
LEGA LADRONA!

(ECCONE LE PROVE
https://oneway2day.files.wordpress.com/2019/01/indagatoaiutalelisteciviche.jpg
http://www.rotadosertao.com/noticia/10516-porto-seguro-policia-investiga-blogueiro-italiano-suspeito-de-estelionato
http://noticiasdeportoseguro.blogspot.com/2011/03/quem-e-pietro-paolo-barrai.html
 
)

É TRUFFATORE, PEDOFILO ED ASSASSINO: PAOLO BARRAI( O TRUFFATORE, PEDOFILO 
ED ASSASSINO PAOLO PIETRO BARRAI). DI CRIMINALE TERRA BITCOIN (ASSOCIAZIONE 
CON INTENTO DI FOTTERE, FREGARE, SPENNARE POLLI VIA INTERNET, IL TUTTO VIA 
NAZIFASCISTA SITO TELEGRAM) E CRIMINALISSIMO BLOG MERCATO LIBERO, ALIAS 
"MERDATO" LIBERO! INDAGATO, AL MOMENTO, DALLA PROCURA DI MILANO. COME PURE 
DA PROCURA DI LUGANO, SCOTLAND YARD LONDRA, FBI NEW YORK, POLICIA CIVIL DI 
PORTO SEGURO (BR).

TROVATE TANTI ALTRI VINCENTISSIMI DETTAGLI, A PROPOSITO DI QUESTO, QUI:
https://comp.lang.python.narkive.com/qkxGCaas/e-pedofilo-ed-assassino-paolo-barrai-di-criminale-terra-bitcoin-e-truffatore-spenna-i-polli-del-web-

-- 
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/8d276e03-62fe-465c-b7de-507d846ac3e4n%40googlegroups.com.


Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-16 Thread Sorawee Porncharoenwase
In general, it would be helpful to provide an example of the macro use, so
that we know what you want to do. If it doesn't work, it would be helpful
to provide the buggy program and an error message so that we can help with
the issue that you are encountering.

>From my guess, you have a variable named abc-foo somewhere, and with this
macro, you wish to define a function named abc that can access the value of
abc-foo? If so, here’s an example of a working program:

#lang racket

(require (for-syntax racket/syntax))

(define-syntax (my-macro stx)
  (syntax-case stx ()
[(_ name other-args ...)
 (with-syntax ([varname (format-id #'name "~a-foo" #'name)])
   #'(define name
   (λ (other-args ...)
 (println (list varname other-args ...)]))

(define abc-foo 123)
(my-macro abc x y)
(abc 5 6) ;=> '(123 5 6)





On Thu, Sep 16, 2021 at 1:21 PM Dimaugh Silvestris <
dimaughsilvest...@gmail.com> wrote:

> (sorry if I'm asking too many questions about macros lately, I'm learning
> about them but I keep running into scenarios I can't find documentation for)
>
> I'm trying to capture the value of a variable whose identifier I can only
> get with format-id, inside a with-syntax.
> Something like this pseudocode (imagine name-foo contains a list of
> symbols):
> (define-syntax (my-macro stx)
>   (syntax-case stx ()
> ((_ name other-args ...)
>  (with-syntax* ((varname (format-id #'name "~a-foo" #'name))
> (varval (cons (datum->syntax #'varname) (datum->syntax
> #'(other-args ...)
>#'(define name (λ varval (print varval)))
>
>
> Which of course doesn't work. I understand this might have to do with how
> macros work at an earlier phase than runtime, so is it impossible?
>
> --
> 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/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CADcueguMfdx5zjRw4iP%3D3_7PhzjpzSMbS02pzVqTPwGMfP7jjQ%40mail.gmail.com.


[racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-16 Thread Dimaugh Silvestris
(sorry if I'm asking too many questions about macros lately, I'm learning
about them but I keep running into scenarios I can't find documentation for)

I'm trying to capture the value of a variable whose identifier I can only
get with format-id, inside a with-syntax.
Something like this pseudocode (imagine name-foo contains a list of
symbols):
(define-syntax (my-macro stx)
  (syntax-case stx ()
((_ name other-args ...)
 (with-syntax* ((varname (format-id #'name "~a-foo" #'name))
(varval (cons (datum->syntax #'varname) (datum->syntax
#'(other-args ...)
   #'(define name (λ varval (print varval)))


Which of course doesn't work. I understand this might have to do with how
macros work at an earlier phase than runtime, so is it impossible?

-- 
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/CAN4YmRF%3Do3NsXOvK2fvUDeYL_jfA9r946%3D%3DguoGb_%3DKyS%3Dm%2Bxw%40mail.gmail.com.


Re: [racket-users] Syntax Parse Bee 2021

2021-09-15 Thread Ben Greenman
The competition is now closed.

Thank you to the participants!!!

We received 22 entries from 15 individuals:

 https://github.com/syntax-objects/Summer2021/issues

The final results of these submissions cover a wide range. Some are macros
that you could use in any Racket project. Others are syntax classes. Still
others are more like starter code for a new DSL.

The code inside these submissions is **very** informative. Whether you're
new to macros or a seasoned syntax parser, there is a lot to learn from.

- Ben + Stephen


On 8/26/21, Ben Greenman  wrote:
> On 8/25/21, Stephen De Gabrielle  wrote:
>> There is only a couple more days! it's not too late!
>>
>
> We have lots of prizes
>

-- 
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/CAFUu9R4kz1nQipSazdzFMoytYXC5pry9yDSgL9dyFKsNzB_VJQ%40mail.gmail.com.


[racket-users] Set logging (or env variables generally) in racket-mode

2021-09-14 Thread David Storrs
racket-mode is terrifically useful, and my only issue with it is that it
doesn't show logging messages.   Is there a way to make it do that?

-- 
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/CAE8gKoffYSXVGYEyLB3ekn%2Br1LPcQBJipnr2XMF9pipGdSdTWg%40mail.gmail.com.


Re: [racket-users] Re: jest...@gmail.com Trouble installing DrRacket

2021-09-14 Thread Matthew Flatt
At Tue, 14 Sep 2021 01:54:44 -0400, George Neuner wrote:
> Is there a list somewhere of which chips have successfully run Racket?
> Or a definitive statement of what ISA is targeted?

For Racket CS, there's a list here:

 https://github.com/racket/racket/tree/master/racket/src/ChezScheme

Granted, that's not the most visible place. That location makes sense
when the Racket branch of Chez Scheme is extracted to its own repo, but
probably the documentation should have it's own list or link to that
list.


For Racket BC, the question is murkier. Racket BC should run on any
platform with a C compiler and enough libraries, although having the
right configuration can be an issue. So, historically, Racket BC is
meant to work on all platforms (misconfiguration treated a bug), and
that's why there hasn't been a list. For the JIT, there's a list in the
documentation:

  https://docs.racket-lang.org/guide/performance.html#%28tech._jit%29

That list could be improved because, as you say, "32-bit ARM" is not
really descriptive enough. It should say something like "ARMv4 and up",
and it should clarify that Windows ARM is not supported (where I expect
that it's more than a matter of configuration to support Windows, and
32-bit Windows ARM seems to be rare, anyway).

-- 
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/20210914075548.160%40sirmail.smtps.cs.utah.edu.


[racket-users] Re: Trouble installing DrRacket

2021-09-14 Thread Nathan Philippon
Processor: Snapdragon (TM) 7c Gen 2 @ 2.55 GHz   2.55 GHz
RAM: 4.00 GB (3.68 GB usable)

On Monday, September 13, 2021 at 11:31:15 a.m. UTC-4 jest...@gmail.com 
wrote:

> That's strange.. I can only guess maybe you're running x64 installer on an 
> x32 system.  What are your pc specs?
>
> On Monday, September 13, 2021 at 8:25:38 AM UTC-7 hockeyfa...@gmail.com 
> wrote:
>
>> I installed the correct DrRacket for my system and when I try to open it 
>> I get this message: [image: Screenshot 2021-09-13 104433.png]
>> Would anyone know what's wrong?
>>
>

-- 
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/b8565131-bbb2-4f79-803a-04b5eb67819en%40googlegroups.com.


[racket-users] Re: Trouble installing DrRacket

2021-09-14 Thread Nathan Philippon
[image: Screenshot 2021-09-13 113439.png]

On Monday, September 13, 2021 at 11:31:15 a.m. UTC-4 jest...@gmail.com 
wrote:

> That's strange.. I can only guess maybe you're running x64 installer on an 
> x32 system.  What are your pc specs?
>
> On Monday, September 13, 2021 at 8:25:38 AM UTC-7 hockeyfa...@gmail.com 
> wrote:
>
>> I installed the correct DrRacket for my system and when I try to open it 
>> I get this message: [image: Screenshot 2021-09-13 104433.png]
>> Would anyone know what's wrong?
>>
>

-- 
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/cca41b55-75aa-4945-9386-1d4da6450a51n%40googlegroups.com.


[racket-users] Re: Trouble installing DrRacket

2021-09-14 Thread jest array
https://download.racket-lang.org/installers/8.2/racket-8.2-i386-win32-bc.exe 
, try installing the x32 version. If you are running something arcane like 
windows on arm or something then I don't know what to do.
On Monday, September 13, 2021 at 8:25:38 AM UTC-7 hockeyfa...@gmail.com 
wrote:

> I installed the correct DrRacket for my system and when I try to open it I 
> get this message: [image: Screenshot 2021-09-13 104433.png]
> Would anyone know what's wrong?
>

-- 
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/59485712-b286-4624-8513-3a3a8f40f16cn%40googlegroups.com.


Re: [racket-users] Re: jest...@gmail.com Trouble installing DrRacket

2021-09-13 Thread George Neuner


On 9/13/2021 10:34 PM, Matthew Flatt wrote:

Just to clarify: Racket runs on a number of ARM variants when running
Linux and other Unix-like operating systems, but we have not yet ported
to Windows on ARM.

Matthew


Is there a list somewhere of which chips have successfully run Racket?
Or a definitive statement of what ISA is targeted?

Just saying "if it runs Linux ..." isn't terribly helpful. /[I realize 
that you did not actually say that.]/   Linux can run in Thumb2, and the 
last time I checked there were at least 4 different ARM architectures 
for which Linux (or some reasonable subset) had been made to run on some 
representative chip.


Doesn't mean Racket will run on it.  It's really applications that 
stress chips, not operating systems.


YMMV,
George


--
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/09ddf2e2-e6bc-045f-8444-f291c92a62a9%40comcast.net.


Re: [racket-users] Re: jest...@gmail.com Trouble installing DrRacket

2021-09-13 Thread Matthew Flatt
Just to clarify: Racket runs on a number of ARM variants when running
Linux and other Unix-like operating systems, but we have not yet ported
to Windows on ARM.

Matthew

At Mon, 13 Sep 2021 11:21:57 -0700 (PDT), Nathan Philippon wrote:
> I think you're right, thanks.
> 
> On Monday, September 13, 2021 at 2:06:03 p.m. UTC-4 gneuner2 wrote:
> 
> >
> > On 9/13/2021 1:02 PM, Nathan Philippon wrote:
> >
> > It's a Samsung GalaxyBook
> >
> > On Monday, September 13, 2021 at 12:48:06 p.m. UTC-4 jest...@gmail.com 
> > wrote:
> >
> >> Yeah, I don't think Racket supports windows on arm devices. I'm guessing 
> >> this is a chromebook or something? HP? Dell? 
> >> On Monday, September 13, 2021 at 8:44:08 AM UTC-7 hockeyfa...@gmail.com 
> >> wrote:
> >>
> >>> I tried replying in the same thread but my messages kept getting 
> >>> deleted. 
> >>> Processor: Snapdragon (TM) 7c Gen 2 @ 2.55 GHz   2.55 GHz
> >>> RAM: 4.00GB
> >>>
> >>
> > Disclaimer:  I am not part of the Racket development team.
> >
> > I don't think Racket is supported on a Chromebook.  Even so, there are a 
> > number of issues with running Racket on ARM ... there simply are too many 
> > variations of ARM chips to test the code on all of them.  Some just can't 
> > run the current codebases (BC or CS), and I am pretty sure BC's JIT 
> > compiler is not supported on any of them.
> >
> > It may be that Racket (currently) just won't work on your chip.  Or it may 
> > be something with ChromeOS.
> >
> >
> > Sorry.  I know this wasn't particularly helpful.
> > George
> >
> 
> -- 
> 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/e397bdd9-5759-4f9f-a472-5bbb5840a
> af7n%40googlegroups.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/20210913203424.221%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] Re: jest...@gmail.com Trouble installing DrRacket

2021-09-13 Thread Nathan Philippon
I think you're right, thanks.

On Monday, September 13, 2021 at 2:06:03 p.m. UTC-4 gneuner2 wrote:

>
> On 9/13/2021 1:02 PM, Nathan Philippon wrote:
>
> It's a Samsung GalaxyBook
>
> On Monday, September 13, 2021 at 12:48:06 p.m. UTC-4 jest...@gmail.com 
> wrote:
>
>> Yeah, I don't think Racket supports windows on arm devices. I'm guessing 
>> this is a chromebook or something? HP? Dell? 
>> On Monday, September 13, 2021 at 8:44:08 AM UTC-7 hockeyfa...@gmail.com 
>> wrote:
>>
>>> I tried replying in the same thread but my messages kept getting 
>>> deleted. 
>>> Processor: Snapdragon (TM) 7c Gen 2 @ 2.55 GHz   2.55 GHz
>>> RAM: 4.00GB
>>>
>>
> Disclaimer:  I am not part of the Racket development team.
>
> I don't think Racket is supported on a Chromebook.  Even so, there are a 
> number of issues with running Racket on ARM ... there simply are too many 
> variations of ARM chips to test the code on all of them.  Some just can't 
> run the current codebases (BC or CS), and I am pretty sure BC's JIT 
> compiler is not supported on any of them.
>
> It may be that Racket (currently) just won't work on your chip.  Or it may 
> be something with ChromeOS.
>
>
> Sorry.  I know this wasn't particularly helpful.
> George
>

-- 
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/e397bdd9-5759-4f9f-a472-5bbb5840aaf7n%40googlegroups.com.


Re: [racket-users] Re: jest...@gmail.com Trouble installing DrRacket

2021-09-13 Thread George Neuner


On 9/13/2021 1:02 PM, Nathan Philippon wrote:

It's a Samsung GalaxyBook

On Monday, September 13, 2021 at 12:48:06 p.m. UTC-4 jest...@gmail.com 
wrote:


Yeah, I don't think Racket supports windows on arm devices. I'm
guessing this is a chromebook or something? HP? Dell?
On Monday, September 13, 2021 at 8:44:08 AM UTC-7
hockeyfa...@gmail.com wrote:

I tried replying in the same thread but my messages kept
getting deleted.
Processor: Snapdragon (TM) 7c Gen 2 @ 2.55 GHz   2.55 GHz
RAM: 4.00GB



Disclaimer:  I am not part of the Racket development team.

I don't think Racket is supported on a Chromebook.  Even so, there are a 
number of issues with running Racket on ARM ... there simply are too 
many variations of ARM chips to test the code on all of them.  Some just 
can't run the current codebases (BC or CS), and I am pretty sure BC's 
JIT compiler is not supported on any of them.


It may be that Racket (currently) just won't work on your chip.  Or it 
may be something with ChromeOS.



Sorry.  I know this wasn't particularly helpful.
George

--
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/a4de3df3-37e0-2292-310f-8cdff35d2f4a%40comcast.net.


[racket-users] Re: jest...@gmail.com Trouble installing DrRacket

2021-09-13 Thread Nathan Philippon
It's a Samsung GalaxyBook

On Monday, September 13, 2021 at 12:48:06 p.m. UTC-4 jest...@gmail.com 
wrote:

> Yeah, I don't think Racket supports windows on arm devices. I'm guessing 
> this is a chromebook or something? HP? Dell?
> On Monday, September 13, 2021 at 8:44:08 AM UTC-7 hockeyfa...@gmail.com 
> wrote:
>
>> I tried replying in the same thread but my messages kept getting deleted.
>> Processor: Snapdragon (TM) 7c Gen 2 @ 2.55 GHz   2.55 GHz
>> RAM: 4.00GB
>>
>

-- 
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/de085db5-68e5-444f-82fb-ded7b4beec2an%40googlegroups.com.


[racket-users] Re: jest...@gmail.com Trouble installing DrRacket

2021-09-13 Thread jest array
Yeah, I don't think Racket supports windows on arm devices. I'm guessing 
this is a chromebook or something? HP? Dell?
On Monday, September 13, 2021 at 8:44:08 AM UTC-7 hockeyfa...@gmail.com 
wrote:

> I tried replying in the same thread but my messages kept getting deleted.
> Processor: Snapdragon (TM) 7c Gen 2 @ 2.55 GHz   2.55 GHz
> RAM: 4.00GB
>

-- 
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/104ee6d0-e35f-4c2d-86c1-46f9e67b6975n%40googlegroups.com.


[racket-users] jest...@gmail.com Trouble installing DrRacket

2021-09-13 Thread Nathan Philippon
I tried replying in the same thread but my messages kept getting deleted.
Processor: Snapdragon (TM) 7c Gen 2 @ 2.55 GHz   2.55 GHz
RAM: 4.00GB

-- 
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/2271875e-9174-47cb-b190-3ce60bae3fedn%40googlegroups.com.


[racket-users] Re: Trouble installing DrRacket

2021-09-13 Thread jest array
That's strange.. I can only guess maybe you're running x64 installer on an 
x32 system.  What are your pc specs?

On Monday, September 13, 2021 at 8:25:38 AM UTC-7 hockeyfa...@gmail.com 
wrote:

> I installed the correct DrRacket for my system and when I try to open it I 
> get this message: [image: Screenshot 2021-09-13 104433.png]
> Would anyone know what's wrong?
>

-- 
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/7bc25de0-9c99-49bf-a2c8-5cadd94b2715n%40googlegroups.com.


[racket-users] Trouble installing DrRacket

2021-09-13 Thread Nathan Philippon
I installed the correct DrRacket for my system and when I try to open it I 
get this message: [image: Screenshot 2021-09-13 104433.png]
Would anyone know what's wrong?

-- 
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/f5a65335-679a-4e7d-a358-840a3caafbcdn%40googlegroups.com.


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

2021-09-10 Thread David Storrs
On Fri, Sep 10, 2021 at 1:33 PM kamist...@gmail.com 
wrote:

> I like the apply max instead of foldl, quite a bit easier.
>
> Instead of `(format "\t~a" (~a (~a k #:width width) v #:separator "\t"))`
> I prefer one of these:
> (~a "\t" (~a k #:width width) "\t" v)
> (~a #:separator "\t" "" (~a k #:width width) v)
>

Fine.  If you want to be all efficient and readable, go right ahead.

Thanks, applied.  :>


> --
> 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/d652f06d-81ed-4a5c-983c-d1716f838a38n%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/d652f06d-81ed-4a5c-983c-d1716f838a38n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAE8gKod3k_wBfCtVPe9daOg%3DXkKvq-ZAcYDcCdHqq-%3DUBQ%3DFbg%40mail.gmail.com.


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

2021-09-10 Thread kamist...@gmail.com
I like the apply max instead of foldl, quite a bit easier.

Instead of `(format "\t~a" (~a (~a k #:width width) v #:separator "\t"))` I 
prefer one of these:
(~a "\t" (~a k #:width width) "\t" v)
(~a #:separator "\t" "" (~a k #:width width) v)

-- 
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/d652f06d-81ed-4a5c-983c-d1716f838a38n%40googlegroups.com.


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

2021-09-10 Thread David Storrs
Thank you, Laurent.  That's a cool package; I think it would work well to
generate tables suitable for org-mode spreadsheets.  I could even pull data
from a sqlite DB, giving me power and portability without needing an
internet connection or a full heavyweight spreadsheet app.

On Thu, Sep 9, 2021 at 5:26 PM Laurent  wrote:

> 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 something that is
>> not an error?  I've been through both The Printer and the
>> raise-arguments-error sections in the Reference and can't find anything.
>>
>> For example:
>>
>> (doit "x" 1 "foo" 2 "super" 3)
>>
>> Returns the string "x 1\nfoo   2\super 3"
>>
>>
>>
>>
>> --
>> 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/CAE8gKod_s8EhQPW9uG7P02%3D8Kmpqf2Uw%3DKLORWD%3DwmFrxnGkWA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAE8gKod_s8EhQPW9uG7P02%3D8Kmpqf2Uw%3DKLORWD%3DwmFrxnGkWA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAE8gKodAzS2-FCt_KxoP-StFvxQpHBnYd1VCwb6sh9n0rPKS-g%40mail.gmail.com.


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

2021-09-10 Thread David Storrs
Wow, thank you Simon.  That was above and beyond.

I should have thought of ~a to start with.  With your pointers I came up
with a less flexible solution that is sufficient to the current issue:


#lang racket/base
(require racket/format
 racket/string)

(define my-keys   '("bacon" "eggs" "pancakes"))
(define my-vals   '("turkey" "whites" "blueberry"))

(define (make-str keys vals)
  (define width (apply max (map string-length keys)))
  (string-join
   (for/list ([k keys]
  [v vals])
 (format "\t~a" (~a (~a k #:width width) v #:separator "\t")))
   "\n"))

(displayln (make-str my-keys my-vals))


On Thu, Sep 9, 2021 at 4:11 PM kamist...@gmail.com 
wrote:

> I am not really aware of a function that does this you could try digging
> into the implementation of raise-arguments-error,
> usually I roll my own implementation depending on what I really want to
> output.
> racket/format and its ~a, ~v, etc. have a lot of useful optional keyword
> arguments like #:align #:pad-string #:width etc.
>
> This isn't totally what you want, but maybe it has something that is
> useful to you.
> This or similar code is what I have used sometimes:
>
> #lang racket
>
> (define current-prefix-length (make-parameter 0))
> (define (prefixln #:prefix [prefix ""]
>   #:align  [align 'left]
>   . message)
>   (displayln (apply ~a (list* (~a prefix #:width (current-prefix-length)
> #:align align)
>   message
>
> (define-syntax-rule (with-indent body ...)
>   (parameterize ([current-prefix-length (+ (current-prefix-length) 2)])
> body ...))
>
> (define (example-func1)
>   (prefixln "start of example func1")
>   (with-indent
> (example-func2))
>   (prefixln "end of example func1"))
>
> (define (example-func2)
>   (prefixln "start of example func2")
>   (prefixln "end of example func2"))
>
>
> (module+ main
>
>   (displayln "Hello checkout these values:")
>   (define example-values
> (hash 'foo 123
>   'this-is-a-long-key "some value"
>   'blabla #f
>   "cake" "is a lie"))
>
>   ;; ugly oneliner to calculate prefix width
>   (current-prefix-length (+ 2 (foldl max 0 (map (compose1 string-length
> ~a) (hash-keys example-values)
>
>   (for ([(k v) (in-hash example-values)]) ;; probably sorting or assoc
> list would make sense too...
> (prefixln #:prefix (~a k ": ") #:align 'right
>   v))
>
>   (current-prefix-length 0)
>   (displayln "")
>   (displayln "indentation through multiple nested calls:")
>   (with-indent
> (example-func1)))
>
> If you use a current-prefix-string parameter instead you can create other
> interesting things like lines indented with indentation level indicators,
> etc.:
> indent0
> | indent1
> | | indent2
> | indent1
> indent0
>
> But I am getting too off-topic...
>
> Simon
>
> david@gmail.com schrieb am Mittwoch, 8. September 2021 um 15:41:56
> UTC+2:
>
>> 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 something that is
>> not an error?  I've been through both The Printer and the
>> raise-arguments-error sections in the Reference and can't find anything.
>>
>> For example:
>>
>> (doit "x" 1 "foo" 2 "super" 3)
>>
>> Returns the string "x 1\nfoo   2\super 3"
>>
>>
>>
>>
>> --
> 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/de65e4a2-7cd3-4347-949f-d8a1f457961en%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/de65e4a2-7cd3-4347-949f-d8a1f457961en%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAE8gKoc5md1TUFJHmRb6%3DNTUJ%2BCzCMLDaQV5poUR64YCAo9bbg%40mail.gmail.com.


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 something that is
> not an error?  I've been through both The Printer and the
> raise-arguments-error sections in the Reference and can't find anything.
>
> For example:
>
> (doit "x" 1 "foo" 2 "super" 3)
>
> Returns the string "x 1\nfoo   2\super 3"
>
>
>
>
> --
> 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/CAE8gKod_s8EhQPW9uG7P02%3D8Kmpqf2Uw%3DKLORWD%3DwmFrxnGkWA%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAE8gKod_s8EhQPW9uG7P02%3D8Kmpqf2Uw%3DKLORWD%3DwmFrxnGkWA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CABNTSaEkkL920XiYB98tJSbRv8jDXHbzTdo-VAoRSkVTeO6Mvw%40mail.gmail.com.


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

2021-09-09 Thread kamist...@gmail.com
I am not really aware of a function that does this you could try digging 
into the implementation of raise-arguments-error,
usually I roll my own implementation depending on what I really want to 
output. 
racket/format and its ~a, ~v, etc. have a lot of useful optional keyword 
arguments like #:align #:pad-string #:width etc.

This isn't totally what you want, but maybe it has something that is useful 
to you.
This or similar code is what I have used sometimes:

#lang racket

(define current-prefix-length (make-parameter 0))
(define (prefixln #:prefix [prefix ""]
  #:align  [align 'left]
  . message)
  (displayln (apply ~a (list* (~a prefix #:width (current-prefix-length) 
#:align align)
  message

(define-syntax-rule (with-indent body ...)
  (parameterize ([current-prefix-length (+ (current-prefix-length) 2)])
body ...))

(define (example-func1)
  (prefixln "start of example func1")
  (with-indent
(example-func2))
  (prefixln "end of example func1"))

(define (example-func2)
  (prefixln "start of example func2")
  (prefixln "end of example func2"))


(module+ main

  (displayln "Hello checkout these values:")
  (define example-values
(hash 'foo 123
  'this-is-a-long-key "some value"
  'blabla #f
  "cake" "is a lie"))

  ;; ugly oneliner to calculate prefix width
  (current-prefix-length (+ 2 (foldl max 0 (map (compose1 string-length ~a) 
(hash-keys example-values)

  (for ([(k v) (in-hash example-values)]) ;; probably sorting or assoc list 
would make sense too...
(prefixln #:prefix (~a k ": ") #:align 'right
  v))

  (current-prefix-length 0)
  (displayln "")
  (displayln "indentation through multiple nested calls:")
  (with-indent
(example-func1)))

If you use a current-prefix-string parameter instead you can create other 
interesting things like lines indented with indentation level indicators, 
etc.:
indent0
| indent1
| | indent2
| indent1
indent0

But I am getting too off-topic...

Simon

david@gmail.com schrieb am Mittwoch, 8. September 2021 um 15:41:56 
UTC+2:

> 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 something that is 
> not an error?  I've been through both The Printer and the 
> raise-arguments-error sections in the Reference and can't find anything.
>
> For example:
>
> (doit "x" 1 "foo" 2 "super" 3)
>
> Returns the string "x 1\nfoo   2\super 3"
>
>
>
>
>

-- 
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/de65e4a2-7cd3-4347-949f-d8a1f457961en%40googlegroups.com.


Re: [racket-users] How to set up rackunit tests to test the REPL?

2021-09-09 Thread Ryan Culpepper
This is one of the few (IMO) legitimate uses of `eval`.

Your test suite should create a namespace, set it up by requiring your
language's module, and then eval interactions expressed as quoted
S-expressions or syntax objects. Here's a basic example for testing `match`:

#lang racket/base
(require syntax/strip-context rackunit)

(define test-ns (make-base-empty-namespace))
(parameterize ((current-namespace test-ns))
  (namespace-require 'racket/base)
  (namespace-require 'racket/match))

;; test-eval : (U Syntax S-expr) -> Any
(define (test-eval expr)
  (parameterize ((current-namespace test-ns))
(eval `(#%top-interaction
. ,(cond [(syntax? expr)
  (namespace-syntax-introduce
   (strip-context expr))]
 [else expr])

(check-equal? (test-eval
   '(match (list 1 2 3)
  [(cons x ys) x]
  [_ #f]))
  1)

(void (test-eval '(define null? zero?))) ;; !!!

(check-equal? (test-eval
   #'(match 0
   [(? null?) 'ok]
   [_ 'no]))
  'ok)

The call to `strip-syntax` is necessary in the second test to make `null?`
refer to the redefinition in the testing namespace instead of the normal
binding visible to the testing module.

Ryan


On Thu, Sep 9, 2021 at 3:31 AM Kuang-Chen Lu 
wrote:

> Hi,
>
> What are the recommended ways to create unit tests that test *both* run
> *and* REPL (#%top-interaction)?
>
> *Background:* I created a custom language and have some unit tests. My
> updated language passed all unit tests. After delivery, a client ran into a
> bug that only happens in REPL. I could have found the bug if the REPL was
> also tested.
>
> Thanks,
>
> KC
>
> --
> 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/e768fbf6-81db-4bb9-9195-6e3ce74a2d55n%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/e768fbf6-81db-4bb9-9195-6e3ce74a2d55n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CANy33q%3D-exnqEROJ1SDngO54T4erg7NUMTSZWagG-KdYO67HzA%40mail.gmail.com.


[racket-users] How to set up rackunit tests to test the REPL?

2021-09-08 Thread Kuang-Chen Lu
Hi,

What are the recommended ways to create unit tests that test *both* run 
*and* REPL (#%top-interaction)?

*Background:* I created a custom language and have some unit tests. My 
updated language passed all unit tests. After delivery, a client ran into a 
bug that only happens in REPL. I could have found the bug if the REPL was 
also tested.

Thanks,

KC

-- 
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/e768fbf6-81db-4bb9-9195-6e3ce74a2d55n%40googlegroups.com.


[racket-users] [module announce] in-out-logged

2021-09-08 Thread David Storrs
Package: https://pkgs.racket-lang.org/package/in-out-logged

Wraps a chunk of code in "entering" and "leaving" log messages, returns the
value(s) produced by the code.

Example:

Keyword arguments are all optional. #:to and #:at may appear in either
order but #:with must come last if it is present.

(define-logger foo)
(define (on-complete op . args)
(log-foo-debug "in on-complete")
(apply op args))

(in/out-logged ("on-complete"
  #:to foo-logger
  #:at 'debug ; NB:  This is the default so it could be
omitted
  "time" (current-inexact-milliseconds))
 (on-complete + 1 2 5))

  (in/out-logged ("values"
  #:at 'error   ; NB:  Goes to (current-logger) since #:to
not given.  Has 'error priority
  #:with "time is: ~a, username is: ~a."
(current-inexact-milliseconds) 'bob)
 (values 1 2))

Produces:

foo: entering on-complete. args:
time  1631134220582.874
foo: in on-complete
foo: leaving on-complete. args:
time  1631134220582.874
8

entering values. time is: 1631134385090.149, username is: bob.
leaving values. time is: 1631134385090.161, username is: bob.
1
2

With thanks to Martin DeMello and Sorawee Porncharoenwase for suggestions
on syntax and functionality.


TODO:  Better formatting of the arguments.






(in/out-logged ("name" #:to foo-logger #:at 'info #:with "args are: ~a ~a" '
arg1 'arg2) code ...)

-- 
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/CAE8gKocMnqcQVw31SQjUqaSoFmZS9TDSy1%2ByT9yf25Py6VmN%3DQ%40mail.gmail.com.


Re: [racket-users] Why does syntax-parser work here but not syntax-parse?

2021-09-08 Thread David Storrs
*headdesk headdesk headdesk headdesk headdesk*

Thank you.

On Wed, Sep 8, 2021 at 2:02 PM Stephen Chang  wrote:

> > shouldn't the entire parenthesized expression be given to the macro
> processor and then replaced with something valid before being rejected?
>
> That would be true if you're defining a macro, i.e. if you use
> `define-syntax` instead of `define`.
>
> >
> > --
> > 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/CAE8gKofDYFY8AYb2Lyh7CQXx1i01w8jm4DVcMrJL%3DQYHX9SsRQ%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/CAE8gKoez09TZCYy7BkiMZ4O1G8rYs4M7vdgGbnJpm0uEJ%3Dr-Kw%40mail.gmail.com.


Re: [racket-users] Why does syntax-parser work here but not syntax-parse?

2021-09-08 Thread Stephen Chang
> shouldn't the entire parenthesized expression be given to the macro processor 
> and then replaced with something valid before being rejected?

That would be true if you're defining a macro, i.e. if you use
`define-syntax` instead of `define`.

>
> --
> 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/CAE8gKofDYFY8AYb2Lyh7CQXx1i01w8jm4DVcMrJL%3DQYHX9SsRQ%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/CAFfiA1LxRJNCNHTi%2Bi8Tz2W4wtJ6_s%3D-2jXQfxyMi%3DHE9hQptg%40mail.gmail.com.


[racket-users] PLDI 2022 First Call for Papers

2021-09-08 Thread 'William J. Bowman' via Racket Users
Please distribute widely.

*Call for Papers*

2022 ACM Conference on Programming Language Design and Implementation (PLDI)
Mon 20 - Fri 24 June 2022
San Diego, California, United States
https://pldi22.sigplan.org/track/pldi-2022-pldi#Call-for-Papers

PLDI is a premier forum for programming language research, broadly construed, 
including design, implementation, theory, applications, and performance. PLDI 
seeks outstanding research that extends and/or applies programming-language 
concepts to advance the field of computing. Novel system designs, thorough 
empirical work, well-motivated theoretical results, and new application areas 
are all welcome emphases in strong PLDI submissions.

Reviewers will evaluate each contribution for its accuracy, significance, 
originality, and clarity. Submissions should be organized to communicate 
clearly to a broad programming-language audience as well as to experts on the 
paper’s topics. Papers should identify what has been accomplished and how it 
relates to previous work.

Authors of empirical papers are encouraged to consider the seven categories of 
the SIGPLAN Empirical Evaluation Guidelines when preparing their submissions. 
(http://www.sigplan.org/Resources/EmpiricalEvaluation/)

*Important Dates*
===
Fri 19 Nov 2021, Submission Deadline
Mon 7 Feb - Wed 9 Feb 2022, Author Response
Fri 25 Feb 2022, Author Notification

*Author Instructions*
==
https://pldi22.sigplan.org/track/pldi-2022-pldi#Call-for-Papers

Submission site: https://pldi2022.hotcrp.com/

*Organizing Committee*

General Chair: Ranjit Jhala, U. of California at San Diego
Program Chair: Isil Dillig, U. of Texas at Austin
Web Chair: Dan Barowy, Williams College
Publicity Co-Chairs: William J. Bowman, U. of British Columbia
Arjun Guha, Northeastern U.
Sponsorship Co-Chairs: Ravi Chugh, U. of Chicago
   Sasa Misailovic, U. of Illinois at Urbana-Champaign
Workshops Co-Chairs: Nadia Polikarpova, U. of California at San Diego
 Alexandra Silva, U. College London
Student Research Competition Co-Chairs: Tyler Sorensen, U. of California at 
Santa Cruz
Jubi Taneja, Microsoft Research
Artifact Evaluation Co-Chairs: Niki Vazou, IMDEA Software Institute
   Xinyu Wang, U. of Michigan

https://pldi22.sigplan.org/committee/pldi-2022-organizing-committee

-- 
William J. Bowman

-- 
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/YTjwBHFscbjUGnVE%40williamjbowman.com.


[racket-users] Why does syntax-parser work here but not syntax-parse?

2021-09-08 Thread David Storrs
This is from the documentation and it obviously works:

(define parser1
  (syntax-parser
[((~alt (~once (~seq #:a x) #:name "#:a keyword")
(~optional (~seq #:b y) #:name "#:b keyword")
(~seq #:c z)) ...)
 'ok]))
(parser1 #'(#:a 1))

When run it yields 'ok.

If I change it to this, it fails and I don't understand why:

(define (parser2 stx)
  (syntax-parse stx
[(parser2 ((~alt (~once (~seq #:a x) #:name "#:a keyword")
 (~optional (~seq #:b y) #:name "#:b keyword")
 (~seq #:c z)) ...))
 #''ok]))
(parser2 (#:a 1))

This yields:
[...source location...] #%datum: keyword misused as an expression
;   at: #:a


I can see that (#:a 1) is not valid under the default parser since #:a is
not valid for initial position but shouldn't the entire parenthesized
expression be given to the macro processor and then replaced with something
valid before being rejected?

-- 
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/CAE8gKofDYFY8AYb2Lyh7CQXx1i01w8jm4DVcMrJL%3DQYHX9SsRQ%40mail.gmail.com.


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

2021-09-08 Thread David Storrs
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 something that is
not an error?  I've been through both The Printer and the
raise-arguments-error sections in the Reference and can't find anything.

For example:

(doit "x" 1 "foo" 2 "super" 3)

Returns the string "x 1\nfoo   2\super 3"

-- 
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/CAE8gKod_s8EhQPW9uG7P02%3D8Kmpqf2Uw%3DKLORWD%3DwmFrxnGkWA%40mail.gmail.com.


[racket-users] Call for Contributions: WITS 2022

2021-09-06 Thread Jesper Cockx
--

CALL FOR CONTRIBUTIONS

  1st Workshop on the Implementation of Type Systems

 WITS 2022

  January 22, 2022
   Philadelphia, PA, USA

  https://popl22.sigplan.org/home/wits-2022

--

WITS 2022 is the first Workshop on the Implementation of Type
Systems. The workshop will be held on January 22, 2022, in
Philadelphia, PA, United States, co-located with POPL. The goal of
this workshop is to bring together the implementors of a variety of
languages with advanced type systems. The main focus is on the
practical issues that come up in the implementation of these systems,
rather than the theoretical frameworks that underlie them. In
particular, we want to encourage exchanging ideas between the
communities around specific systems that would otherwise be accessible
to only a very select group.

Given the importance of collaboration among the attendees at WITS, if
circumstances around covid-19 force POPL (and its co-located events)
to go virtual, WITS will be deferred until a time when we can come
together safely in person.

The workshop will have a mix of invited and contributed talks,
organized discussion times, and informal collaboration time.

*Scope*

We invite participants to share their experiences, study differences
among the implementations, and generalize lessons from those. We also
want to promote the creation of a shared vocabulary and set of best
practices for implementing type systems.

Here are a few examples of topics we are interested to discuss:

 * syntax with binders and substitution
 * conversion modulo beta and eta
 * implicit arguments and metavariables
 * unification and constraint solving
 * metaprogramming and tactic languages
 * editor integration and automation
 * discoverability of language features
 * pretty printing and error messages

This list is not exhaustive, so please contact the PC chairs in case
you are unsure if a topic falls within the scope of the workshop.

*Submissions*

WITS solicits two kinds of submissions:

* Contributed talks on the basis of an abstract. This can be on
  recently published or submitted work, work in progress, or even a
  project that is still in the idea phase.

* Proposals for roundtable discussions. This can be on any topic
  within the scope of the workshop, but should have a broader scope
  than a contributed talk. If accepted, you will be in charge of
  leading a discussion of 45 minutes around the proposed topic
  together with other interested attendees.

Both kinds of proposals should be accompanied by an abstract of max. 1
page (exclusive of references), formatted according to the guidelines
for SIGPLAN conferences: use the `sigplan` option to the `acmart`
LaTeX document class. WITS will have no published proceedings, so
submitting to WITS does not interfere with submission (before, after,
or simultaneously) with other venues. Submissions are handled via
https://wits22.hotcrp.com/.

*Important Dates*

- Abstract submission deadline: 16 November, 2021 (AoE)
- Notification: 1 December, 2021 (AoE)
- Workshop in Philadelphia: 22 January, 2022

*Attendance and registration*

WITS 2022 is colocated with POPL 2022 in Philadelphia, USA. More
information on registration and attendance will be announced later.

*Program Committee*

William J. Bowman, U. of British Columbia, Canada
Jesper Cockx, TU Delft, Netherlands (co-chair)
Leonardo de Moura, Microsoft Research, USA
Richard A. Eisenberg, Tweag, USA (co-chair)
András Kovács, Eotvos Lorand U., Hungary
Pierre-Marie Pédrot, INRIA, France
Aaron Stump, U. of Iowa, USA
Niki Vazou, IMDEA, Spain

-- 
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/d0a562c1-a708-4bba-b23f-5bc5bec9adc0n%40googlegroups.com.


Re: [racket-users] Bootstrap on Racket

2021-09-05 Thread Sage Gerard
Also check koyo and Axio

On 9/4/21 12:14 PM, 'John Clements' via Racket Users wrote:
> I use Greg Hendershott’s excellent and trouble-free ‘frog’ library. How would 
> your code relate to this?
>
> John
>
>> On Aug 30, 2021, at 10:57, Dexter Lagan  wrote:
>>
>> Hi again,
>>
>>I've been working on porting my Newstrap Web framework from newLISP to 
>> Racket. I got most of it done and am about to start work on a router. Here's 
>> what I got so far:
>>
>> DexterLagan/rap: Combination of Racket and Bootstrap, RAP is a Web framework 
>> aiming to produce good-looking pages with ease. (github.com)
>>
>> based on Newsrap:
>>
>> DexterLagan/newstrap: A fast, lightweight web framework written in newLISP. 
>> (github.com)
>>
>>Does anybody know if something similar already exists? I looked around 
>> but couldn't find anything production-ready (in Racket). I just want to know 
>> if I'm wasting my time reinventing the wheel, or if there's value in having 
>> a bunch of macros generate Bootstrap code. My first goal would be to have a 
>> static site generator going, followed by a fully-featured framework for 
>> production use.
>>
>> Any and all feedback would help me greatly!
>>
>> Dex
>>
>>
>> --
>> 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/473170ba-624a-4339-b499-9e936765603cn%40googlegroups.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/75aa8867-0487-412e-9ce3-22edefb0a1e0%40mtasv.net.

-- 
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/21b5e69a-4da7-8878-ef29-f2e22dfd4bf3%40sagegerard.com.


Re: [racket-users] Bootstrap on Racket

2021-09-04 Thread 'John Clements' via Racket Users
I use Greg Hendershott’s excellent and trouble-free ‘frog’ library. How would 
your code relate to this?

John

> On Aug 30, 2021, at 10:57, Dexter Lagan  wrote:
> 
> Hi again,
> 
>   I've been working on porting my Newstrap Web framework from newLISP to 
> Racket. I got most of it done and am about to start work on a router. Here's 
> what I got so far:
> 
> DexterLagan/rap: Combination of Racket and Bootstrap, RAP is a Web framework 
> aiming to produce good-looking pages with ease. (github.com)
> 
> based on Newsrap:
> 
> DexterLagan/newstrap: A fast, lightweight web framework written in newLISP. 
> (github.com)
> 
>   Does anybody know if something similar already exists? I looked around but 
> couldn't find anything production-ready (in Racket). I just want to know if 
> I'm wasting my time reinventing the wheel, or if there's value in having a 
> bunch of macros generate Bootstrap code. My first goal would be to have a 
> static site generator going, followed by a fully-featured framework for 
> production use.
> 
> Any and all feedback would help me greatly!
> 
> Dex
> 
> 
> -- 
> 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/473170ba-624a-4339-b499-9e936765603cn%40googlegroups.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/75aa8867-0487-412e-9ce3-22edefb0a1e0%40mtasv.net.


[racket-users] RacketCon 2021

2021-09-04 Thread Jay McCarthy
In November 2021, on the weekend of the 5th through 7th, we'll be holding a
virtual RacketCon, like we did in October 2020.

We'll follow a similar pattern to last year: an evening social on Friday,
then talks on Saturday and Sunday.

Please put this on your calendars, and please let me know if you have a
talk in mind that you'd like to give.

Best regards,

Jay

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.

-- 
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/CAJYbDakBH_qxcbnUwHEWPBM6yh4KVtQWQR%2B8TA%3D4jPYu8tEVkA%40mail.gmail.com.


Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-03 Thread David Storrs
On Thu, Sep 2, 2021 at 5:32 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> Thoughts:
>
>- Perhaps the logger should be optional. The default value would be
>(current-logger).
>- The event name (like on-complete) could also be optional. The
>default would be the source location of the macro invocation site
>- Instead of “time: ~a”, I think it would be nice to support many
>“pairs”, which are formatted like raise-arguments-error.
>
> Example:
>
> (define (on-complete x)
>   (log-test-debug "I'm in on-complete")
>   x)
>
> (with-log ()
>   1)
>
> (with-log (#:logger test-debug
>#:msg "on-complete"
>["time" (current-seconds)])
>   (on-complete (person 'bob)))
>
> would output:
>
> test: entering test.rkt:5:1
> test: exiting test.rkt:5:1
> result: 1
> 1
> test: entering on-complete
> time: 123
> test: I'm in on-complete
> test: exiting on-complete
> time: 124
> result: (person 'bob)
> (person 'bob)
>
>
>
First of all, thank you.  I like the idea of the event name being optional
and the logger defaulting but I'm not keen on the syntax.  It's very
verbose for something that might occasionally be wrapped around a single
line of code. The raise-arguments-error formatting would be a nice default
but I prefer to give the option to use a format string if you want
something different.


> On Thu, Sep 2, 2021 at 2:06 PM Martin DeMello 
> wrote:
>
>> I do like the second form better, especially since the actual code being
>> run is not obscured by simply being the last argument to a long log
>> function.
>>
>
Cool.  I'll move towards that.


>> martin
>>
>> On Thu, Sep 2, 2021 at 1:55 PM David Storrs 
>> wrote:
>>
>>> I often find that for debugging I want to see a log message saying "I'm
>>> about to do X" followed by X followed by "I'm done with X" and I want it to
>>> return the result of X.
>>>
>>> I wrote this macro and posted it to the package server:
>>> https://pkgs.racket-lang.org/package/log-bracketed
>>>
>>> In retrospect, the syntax is bad and I should change it.  Can anyone
>>> suggest something better?
>>>
>>>   (define (on-complete x) (log-test-debug "entering on-complete") x)
>>>   (struct person (name) #:transparent)
>>>
>>>   (log-bracketed test-debug "on-complete" "time: ~a" (current-seconds) 
>>> (on-complete (person 'bob)))
>>>   (log-bracketed test-debug "on-complete" "" "no user-specified logging 
>>> information")
>>>
>>> Spits out:
>>>
>>>
>>> test: about to on-complete. time: 1630611613
>>> test: entering on-complete
>>> test: after on-complete. time: 1630611613. result: (person 'bob)
>>> (person 'bob)
>>> test: about to on-complete
>>> test: after on-complete. result: "no user-specified logging information"
>>> "no user-specified logging information"
>>>
>>>
>>> The problem is that this looks like it's a simple logging message when
>>> in fact it's real code that should not be ignored.  I'm trying to think of
>>> a better way to do it...maybe something like this?:
>>>
>>>   (with-bracketing-logs ([test-debug "on-complete" "time: ~a" 
>>> (current-seconds)])
>>>
>>>  (on-complete (person 'bob))
>>>
>>>
>>>
>>> --
>>> 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/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/racket-users/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CAFrFfuEqt1NVjE2Ft1JVArvWnKUBvK7jPVoLqPhYCd-dB00A3Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAFrFfuEqt1NVjE2Ft1JVArvWnKUBvK7jPVoLqPhYCd-dB00A3Q%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAE8gKod16Tto8j3U_F1JffJujFQozxmxmdoSLhyw95gQkh%2BiVw%40mail.gmail.com.


Re: [racket-users] Is there an easy way to disable a GUI element?

2021-09-03 Thread Ryan Kramer
Perfect, thanks. I thought I explored all the relevant interfaces but I 
must have overlooked window<%>.

On Friday, September 3, 2021 at 1:00:37 AM UTC-5 gneuner2 wrote:

>
>
> On 9/2/2021 5:39 PM, Ryan Kramer wrote:
>
> I see that button% has an `enabled` field, but I'm not seeing anything for 
> slider%, text-field%, and choice%. If I want to disable these elements, do 
> I have to roll my own enable/disable logic? Also, is there a way to change 
> a button's `enabled` status after it is created? Thanks.
>
>
> All the controls respond to window<%> messages: e.g., (send *mybutton*  
> enable #t)
> https://docs.racket-lang.org/gui/window___.html
>
> Whenever possible, you should try to use object messaging / method calls 
> rather than directly messing with fields in the objects (even if the fields 
> are public).
> https://docs.racket-lang.org/reference/ivaraccess.html
>
>
>
>

-- 
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/35e042ba-c3d4-4d77-807f-6f4ee4965ba0n%40googlegroups.com.


Re: [racket-users] Is there an easy way to disable a GUI element?

2021-09-03 Thread George Neuner



On 9/2/2021 5:39 PM, Ryan Kramer wrote:
I see that button% has an `enabled` field, but I'm not seeing anything 
for slider%, text-field%, and choice%. If I want to disable these 
elements, do I have to roll my own enable/disable logic? Also, is 
there a way to change a button's `enabled` status after it is created? 
Thanks.


All the controls respond to window<%> messages: e.g., (send /mybutton/ 
enable #t)

    https://docs.racket-lang.org/gui/window___.html

Whenever possible, you should try to use object messaging / method calls 
rather than directly messing with fields in the objects (even if the 
fields are public).

    https://docs.racket-lang.org/reference/ivaraccess.html



--
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/86b63058-bbd4-f0d0-e9d3-af625c3b85c9%40comcast.net.


[racket-users] Is there an easy way to disable a GUI element?

2021-09-02 Thread Ryan Kramer
I see that button% has an `enabled` field, but I'm not seeing anything for 
slider%, text-field%, and choice%. If I want to disable these elements, do 
I have to roll my own enable/disable logic? Also, is there a way to change 
a button's `enabled` status after it is created? Thanks.

-- 
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/82ede02f-577a-4f93-bb70-ef28f65c6f84n%40googlegroups.com.


Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread Sorawee Porncharoenwase
Thoughts:

   - Perhaps the logger should be optional. The default value would be
   (current-logger).
   - The event name (like on-complete) could also be optional. The default
   would be the source location of the macro invocation site
   - Instead of “time: ~a”, I think it would be nice to support many
   “pairs”, which are formatted like raise-arguments-error.

Example:

(define (on-complete x)
  (log-test-debug "I'm in on-complete")
  x)

(with-log ()
  1)

(with-log (#:logger test-debug
   #:msg "on-complete"
   ["time" (current-seconds)])
  (on-complete (person 'bob)))

would output:

test: entering test.rkt:5:1
test: exiting test.rkt:5:1
result: 1
1
test: entering on-complete
time: 123
test: I'm in on-complete
test: exiting on-complete
time: 124
result: (person 'bob)
(person 'bob)



On Thu, Sep 2, 2021 at 2:06 PM Martin DeMello 
wrote:

> I do like the second form better, especially since the actual code being
> run is not obscured by simply being the last argument to a long log
> function.
>
> martin
>
> On Thu, Sep 2, 2021 at 1:55 PM David Storrs 
> wrote:
>
>> I often find that for debugging I want to see a log message saying "I'm
>> about to do X" followed by X followed by "I'm done with X" and I want it to
>> return the result of X.
>>
>> I wrote this macro and posted it to the package server:
>> https://pkgs.racket-lang.org/package/log-bracketed
>>
>> In retrospect, the syntax is bad and I should change it.  Can anyone
>> suggest something better?
>>
>>   (define (on-complete x) (log-test-debug "entering on-complete") x)
>>   (struct person (name) #:transparent)
>>
>>   (log-bracketed test-debug "on-complete" "time: ~a" (current-seconds) 
>> (on-complete (person 'bob)))
>>   (log-bracketed test-debug "on-complete" "" "no user-specified logging 
>> information")
>>
>> Spits out:
>>
>>
>> test: about to on-complete. time: 1630611613
>> test: entering on-complete
>> test: after on-complete. time: 1630611613. result: (person 'bob)
>> (person 'bob)
>> test: about to on-complete
>> test: after on-complete. result: "no user-specified logging information"
>> "no user-specified logging information"
>>
>>
>> The problem is that this looks like it's a simple logging message when in
>> fact it's real code that should not be ignored.  I'm trying to think of a
>> better way to do it...maybe something like this?:
>>
>>   (with-bracketing-logs ([test-debug "on-complete" "time: ~a" 
>> (current-seconds)])
>>
>>  (on-complete (person 'bob))
>>
>>
>>
>> --
>> 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/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAFrFfuEqt1NVjE2Ft1JVArvWnKUBvK7jPVoLqPhYCd-dB00A3Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAFrFfuEqt1NVjE2Ft1JVArvWnKUBvK7jPVoLqPhYCd-dB00A3Q%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CADcuegtr0B5dwrCcQzRGeASOpGXs93-ZErSFK-C1pVXjObg%2Bgg%40mail.gmail.com.


Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread Martin DeMello
I do like the second form better, especially since the actual code being
run is not obscured by simply being the last argument to a long log
function.

martin

On Thu, Sep 2, 2021 at 1:55 PM David Storrs  wrote:

> I often find that for debugging I want to see a log message saying "I'm
> about to do X" followed by X followed by "I'm done with X" and I want it to
> return the result of X.
>
> I wrote this macro and posted it to the package server:
> https://pkgs.racket-lang.org/package/log-bracketed
>
> In retrospect, the syntax is bad and I should change it.  Can anyone
> suggest something better?
>
>   (define (on-complete x) (log-test-debug "entering on-complete") x)
>   (struct person (name) #:transparent)
>
>   (log-bracketed test-debug "on-complete" "time: ~a" (current-seconds) 
> (on-complete (person 'bob)))
>   (log-bracketed test-debug "on-complete" "" "no user-specified logging 
> information")
>
> Spits out:
>
>
> test: about to on-complete. time: 1630611613
> test: entering on-complete
> test: after on-complete. time: 1630611613. result: (person 'bob)
> (person 'bob)
> test: about to on-complete
> test: after on-complete. result: "no user-specified logging information"
> "no user-specified logging information"
>
>
> The problem is that this looks like it's a simple logging message when in
> fact it's real code that should not be ignored.  I'm trying to think of a
> better way to do it...maybe something like this?:
>
>   (with-bracketing-logs ([test-debug "on-complete" "time: ~a" 
> (current-seconds)])
>
>  (on-complete (person 'bob))
>
>
>
> --
> 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/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAFrFfuEqt1NVjE2Ft1JVArvWnKUBvK7jPVoLqPhYCd-dB00A3Q%40mail.gmail.com.


[racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread David Storrs
I often find that for debugging I want to see a log message saying "I'm
about to do X" followed by X followed by "I'm done with X" and I want it to
return the result of X.

I wrote this macro and posted it to the package server:
https://pkgs.racket-lang.org/package/log-bracketed

In retrospect, the syntax is bad and I should change it.  Can anyone
suggest something better?

  (define (on-complete x) (log-test-debug "entering on-complete") x)
  (struct person (name) #:transparent)

  (log-bracketed test-debug "on-complete" "time: ~a" (current-seconds)
(on-complete (person 'bob)))
  (log-bracketed test-debug "on-complete" "" "no user-specified
logging information")

Spits out:


test: about to on-complete. time: 1630611613
test: entering on-complete
test: after on-complete. time: 1630611613. result: (person 'bob)
(person 'bob)
test: about to on-complete
test: after on-complete. result: "no user-specified logging information"
"no user-specified logging information"


The problem is that this looks like it's a simple logging message when in
fact it's real code that should not be ignored.  I'm trying to think of a
better way to do it...maybe something like this?:

  (with-bracketing-logs ([test-debug "on-complete" "time: ~a"
(current-seconds)])

 (on-complete (person 'bob))

-- 
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/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com.


Re: [racket-users] gen:custom-write macro

2021-09-01 Thread Sorawee Porncharoenwase
There are positions that macros can’t operate.
https://lexi-lambda.github.io/blog/2018/10/06/macroexpand-anywhere-with-local-apply-transformer/
explains this issue really well, so I recommend you to read it.

There’s also another issue, which is that you want write-proc to be named
write-proc, but Racket, which has a hygienic macro system, will “rename” it
automatically for you. So you need to explicitly indicate that you want the
name write-proc. Like this:

#lang racket

(require racket/struct)

(define-syntax (print-as stx)
  (syntax-case stx ()
[(_ lam1 lam2)
 #`(define #,(datum->syntax stx 'write-proc)
 (make-constructor-style-printer
  lam1 lam2))]))

(struct point (x y)
  #:methods gen:custom-write
  [(print-as
   (lambda (obj) 'p)
   (lambda (obj)
 (list [point-x obj] [point-y obj])))])

(point 1 2)

On Wed, Sep 1, 2021 at 10:26 AM Dimaugh Silvestris
dimaughsilvest...@gmail.com <http://mailto:dimaughsilvest...@gmail.com>
wrote:

Tired of writing:
>
> #:methods gen:custom-write
>   [(define write-proc
>  (make-constructor-style-printer
>   (lambda (x) blablabla)
>   (lambda (x) blablabla)))]
>
> I made this macro:
>
> (define-syntax (print-as stx)
>   (syntax-case stx []
> {[_ lam1 lam2]
>  #'[(define write-proc
>   (make-constructor-style-printer
>lam1 lam2))]}))
>
> So I could just:
>
> (struct point (x y)
>   #:methods gen:custom-write
>   [print-as
>(lambda (obj) 'p)
>(lambda (obj)
>  (list [point-x obj] [point-y obj]))])
>
> But I get a bad syntax error. I've tried many subtle changes to no avail.
> What am I doing wrong?
>
> --
> 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/CAN4YmRH0jUXyG3YMKojrP2WSAKunrCjtN%3DyTFN2dPjmvvQDVdg%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAN4YmRH0jUXyG3YMKojrP2WSAKunrCjtN%3DyTFN2dPjmvvQDVdg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CADcuegshmaQGZbAUNOpmVZd0B0Wrt5Adu4BuJm1dpfnxqPFz4A%40mail.gmail.com.


[racket-users] gen:custom-write macro

2021-09-01 Thread Dimaugh Silvestris
Tired of writing:

#:methods gen:custom-write
  [(define write-proc
 (make-constructor-style-printer
  (lambda (x) blablabla)
  (lambda (x) blablabla)))]

I made this macro:

(define-syntax (print-as stx)
  (syntax-case stx []
{[_ lam1 lam2]
 #'[(define write-proc
  (make-constructor-style-printer
   lam1 lam2))]}))

So I could just:

(struct point (x y)
  #:methods gen:custom-write
  [print-as
   (lambda (obj) 'p)
   (lambda (obj)
 (list [point-x obj] [point-y obj]))])

But I get a bad syntax error. I've tried many subtle changes to no avail.
What am I doing wrong?

-- 
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/CAN4YmRH0jUXyG3YMKojrP2WSAKunrCjtN%3DyTFN2dPjmvvQDVdg%40mail.gmail.com.


[racket-users] IFL'21 final call for participation

2021-08-30 Thread Pieter Koopman




IFL 2021



33rd Symposium on Implementation and Application of Functional Languages





 venue: online

  1 - 3 September 2021



 https://ifl21.cs.ru.nl
<https://ifl21-publicity-dot-yamm-track.appspot.com/Redirect?ukey=1NdKhGOLpmlYX_0BVua0V5yyanFkJBhfIIDW1X2vaVQE-31163156=YAMMID-51953407=https://ifl21.cs.ru.nl/>





*Registration*


*Registration is **free of charge, but required for participation!* We will
mail the zoom link only to registered participants. Use the below link to
register for IFL 2021:



https://docs.google.com/forms/d/e/1FAIpQLSdMFjo-GumKjk4i7szs7n4DhWqKt96t8ofIqshfQFrf4jnvsA/viewform?usp=sf_link
<https://ifl21-publicity-dot-yamm-track.appspot.com/Redirect?ukey=1NdKhGOLpmlYX_0BVua0V5yyanFkJBhfIIDW1X2vaVQE-31163156=YAMMID-51953407=https://docs.google.com/forms/d/e/1FAIpQLSdMFjo-GumKjk4i7szs7n4DhWqKt96t8ofIqshfQFrf4jnvsA/viewform?usp=sf_link>



*Program*

The program is now available at https://ifl21.cs.ru.nl/Program
<https://ifl21-publicity-dot-yamm-track.appspot.com/Redirect?ukey=1NdKhGOLpmlYX_0BVua0V5yyanFkJBhfIIDW1X2vaVQE-31163156=YAMMID-51953407=https://ifl21.cs.ru.nl/Program>
.

*Scope*

The goal of the IFL symposia is to bring together researchers actively
engaged in the implementation and application of functional and
function-based programming languages. IFL 2021 will be a venue for
researchers to present and discuss new ideas and concepts, work in
progress, and publication-ripe results related to the implementation and
application of functional languages and function-based programming.



*Organisation*

IFL 2021 Chairs: Pieter Koopman and Peter Achten, Radboud University, The
Netherlands

IFL Publicity chair: Pieter Koopman, Radboud University, The Netherlands



*PC*

Peter Achten (co-chair)   - Radboud University, Netherlands

Thomas van Binsbergen - University of Amsterdam, Netherlands

Edwin Brady   - University of St. Andrews, Scotland

Laura Castro  - University of A Coruña, Spain

Youyou Cong   - Tokyo Institute of Technology, Japan

Olaf Chitil   - University of Kent, England

Andy Gill - University of Kansas, USA

Clemens Grelck- University of Amsterdam, Netherlands

John Hughes   - Chalmers University, Sweden

Pieter Koopman (co-chair) - Radboud University, Netherlands

Cynthia Kop   - Radboud University, Netherlands

Jay McCarthey - University of Massachussetts Lowell, USA

Neil Mitchell - Facebook, England

Jan De Muijnck-Hughes - Glasgow University, Scotland

Keiko Nakata  - SAP Innovation Center Potsdam, Germany

Jurriën Stutterheim   - Standard Chartered, Singapore

Simon Thompson- University of Kent, England

Melinda Tóth  - Eötvos Loránd University, Hungary

Phil Trinder  - Glasgow University, Scotland

Meng Wang - University of Bristol, England

Viktória Zsók - Eötvos Loránd University, Hungary
[image: beacon]

-- 
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/CAGtcRvB_8DMdGk4QY8YzQO4xBTSgji-ycxCKyiRQFhi57X3REQ%40mail.gmail.com.


Re: [racket-users] 'compiled' binary still depending on libs?

2021-08-30 Thread Matthew Flatt
Some libraries have extra run-time files that they refer to with
`define-runtime-path` and similar. I think "gregor" is in that
category, where it needs files like "timezone.xml". Embedding DLLs
can't embed those extra files.

The intent is that you use `raco distribute` to package an executable
along with any needed run-time files into a directory. That whole
directory can then be moved to another machine to run it.

At Mon, 30 Aug 2021 07:47:34 -0700 (PDT), Dexter Lagan wrote:
> Hi folks,
> 
>   I'm getting a strange dependency problem when attempting to run my 
> Invoicer binary on systems with corrupted or missing Racket libs. For 
> example, if I attempt to run the compiled binary (with embedded DLLs, 
> Windows 10 x64) on a system which has Racket installed, but missing Gregor, 
> I get an error claiming the gregor package is missing. Yet I was under the 
> impression that compiling to binary for distribution, especially with 
> embedded DLLs, would not require ANY libs installed. Is there a reason for 
> this?
> 
> Here's the program in question:
> DexterLagan/invoicer: A dead-simple, easy-to-use minimalist billing 
> application. (github.com) <https://github.com/DexterLagan/invoicer>
> 
> Thanks in advance!
> 
> Dexter

-- 
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/20210830091402.5f%40sirmail.smtps.cs.utah.edu.


[racket-users] Bootstrap on Racket

2021-08-30 Thread Dexter Lagan
Hi again,

  I've been working on porting my Newstrap Web framework from newLISP to 
Racket. I got most of it done and am about to start work on a router. 
Here's what I got so far:

DexterLagan/rap: Combination of Racket and Bootstrap, RAP is a Web 
framework aiming to produce good-looking pages with ease. (github.com) 
<https://github.com/DexterLagan/rap>

based on Newsrap:

DexterLagan/newstrap: A fast, lightweight web framework written in newLISP. 
(github.com) <https://github.com/DexterLagan/newstrap>

  Does anybody know if something similar already exists? I looked around 
but couldn't find anything production-ready (in Racket). I just want to 
know if I'm wasting my time reinventing the wheel, or if there's value in 
having a bunch of macros generate Bootstrap code. My first goal would be to 
have a static site generator going, followed by a fully-featured framework 
for production use.

Any and all feedback would help me greatly!

Dex

-- 
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/473170ba-624a-4339-b499-9e936765603cn%40googlegroups.com.


<    1   2   3   4   5   6   7   8   9   10   >