[racket-users] PLDI 2023, Call for Workshops and Tutorials

2022-10-11 Thread 'William J. Bowman' via Racket Users
Please distribute widely:

# Call for Workshops and Tutorials

PLDI 2023 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 **Saturday June 17th**, and **Sunday June 19th**. 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, 
2023** if there will be proceedings (final versions due **May 5, 2023**), or 
**May 5, 2023** if they do not have proceedings.

## Submission
Submission site: 
https://pldi23.sigplan.org/createProposal/56d4b837-caa0-487c-85b8-61f855c8aa4f

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

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

## 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
- Zachary Tatlock, U. of Washington

-- 
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/beaa2ef6-afd2-4686-829a-390eb69f5620n%40googlegroups.com.

Beyond the Racket Users Google Group, Racket Discussions take place on 
Discourse ( https://racket.discourse.group/ ) and Discord ( 
https://discord.gg/6Zq8sH5 ). Discussion (but less active) also takes place on 
the Racket Slack https://racket.slack.com/ ( sign up at 
https://racket-slack.herokuapp.com/ ), and IRC #racket 
https://kiwiirc.com/nextclient/irc.libera.chat/#racket
--- 
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/Y0XHINh8UXgsshbT%40williamjbowman.com.


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

2021-11-29 Thread 'William J. Bowman' via Racket Users
My spamassassin catches most of it, but also sometimes catches real list emails 
because it has stopped trusting racket-users. Some combination of bayes and 
txrep plugins are doing the heavy lifting, I think.

--
William J. Bowman

On Mon, Nov 29, 2021 at 05:45:37PM -0600, Nathaniel Griswold wrote:
> It’s getting through my filters, neither rspamd or my local client can catch 
> on to it.
> 
> Is there a good simple filter?
> 
> Nate
> 
> -- 
> 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/81262C45-D4BE-45DB-B126-5BD11274299A%40nan.sh.

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


[racket-users] PLDI 2022 Second Call for Papers

2021-10-13 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/YWcmolNG9ihOY7zx%40williamjbowman.com.


Re: [racket-users] rename-out not working as expected

2021-10-12 Thread 'William J. Bowman' via Racket Users
I think this is the expected behaviour of `rename-out`; you might want this 
library to change the dynamic displayed name:
  https://docs.racket-lang.org/static-rename/index.html

--
William J. Bowman

On Tue, Oct 12, 2021 at 03:07:13PM -0400, David Storrs wrote:
> ---
> ; test.rkt
> #lang racket
> (define (do-something) "ok")
> (provide do-something)
> 
> ; test2.rkt
> #lang racket
> (require "test.rkt")
> (provide (rename-out [do-something do-it]))
> 
> #lang racket
> (require "test2.rkt")
> do-it
> ---
> 
> The printed value is # although I was expecting
> #.  Have I done something wrong or simply misunderstood
> how rename-out works?
> 
> -- 
> 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/CAE8gKodiRBWPK5MfgYnOi_V%2B%3DwwFzBxtQK1qV2Mj-zPuHEXn9g%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/YWXekUFzaEkaitiB%40williamjbowman.com.


Re: [racket-users] Restarting loop from exception handler breaks with-handlers, Ctrl+C?

2021-10-07 Thread 'William J. Bowman' via Racket Users
Ah of course, thanks!

On Thu, Oct 07, 2021 at 05:52:55PM -0700, Sorawee Porncharoenwase wrote:
> Typo: with-handlers*
> 
> On Thu, Oct 7, 2021 at 5:52 PM Sorawee Porncharoenwase <
> sorawee.pw...@gmail.com> wrote:
> 
> > I think you want with-handler*? According to the docs:
> >
> > with-handlers:
> >
> > Before any predicate or handler procedure is invoked, the continuation of
> > the entire with-handlers
> > <https://docs.racket-lang.org/reference/exns.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._with-handlers%29%29>
> > expression is restored, but also parameterize-break
> > <https://docs.racket-lang.org/reference/breakhandler.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._parameterize-break%29%29>ed
> > to disable breaks. Thus, breaks are disabled by default during the
> > predicate and handler procedures (see Breaks
> > <https://docs.racket-lang.org/reference/breakhandler.html>), and the
> > exception handler is the one from the continuation of the with-handlers
> > <https://docs.racket-lang.org/reference/exns.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._with-handlers%29%29>
> > expression.
> >
> > with-handler*
> >
> > Like with-handlers
> > <https://docs.racket-lang.org/reference/exns.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._with-handlers%29%29>,
> > but if a handler-expr procedure is called, breaks are not explicitly
> > disabled, and the handler call is in tail position with respect to the
> > with-handlers*
> > <https://docs.racket-lang.org/reference/exns.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._with-handlers%2A%29%29>
> > form.
> >
> > On Thu, Oct 7, 2021 at 5:36 PM 'William J. Bowman' via Racket Users <
> > racket-users@googlegroups.com> wrote:
> >
> >> I have a little model of a server below. The server handles all
> >> exceptions, and restarts itself after some errors. It also handles break?,
> >> to actually exit when requested.
> >>
> >> While this server is running, if I press Ctrl+C before `(error 'foo)` is
> >> handled, the server exits correctly with 120. However, if I press Ctrl+C
> >> after `(error 'foo)` is handled, the `exn:break?` handler is never called,
> >> the server no longer responds to `Ctrl+C`, and (in this example) it
> >> eventually exits with status `1`.
> >>
> >> I cannot figure out why. As far as I can tell, this should always handle
> >> `Ctrl+C` by exiting with 120.
> >>
> >> > #lang racket/base
> >> >
> >> > (let loop ([n 0])
> >> >   (with-handlers ([exn:break? (lambda _ (exit 120))]
> >> >   [void
> >> >(lambda (exn)
> >> >  (printf "handled error: ~a~n" (exn-message exn))
> >> >  (loop (add1 n)))])
> >> > (displayln n)
> >> > (sleep 1)
> >> > (cond
> >> >   [(zero? n) (error 'foo)]
> >> >   [(= n 5) (exit 1)])
> >> > (loop (add1 n
> >>
> >> --
> >> 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/YV%2BSWNpldfOB5tA3%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/YV%2BxxtvNutlP/NZC%40williamjbowman.com.


[racket-users] Restarting loop from exception handler breaks with-handlers, Ctrl+C?

2021-10-07 Thread &#x27;William J. Bowman&#x27; via Racket Users
I have a little model of a server below. The server handles all exceptions, and 
restarts itself after some errors. It also handles break?, to actually exit 
when requested.

While this server is running, if I press Ctrl+C before `(error 'foo)` is 
handled, the server exits correctly with 120. However, if I press Ctrl+C after 
`(error 'foo)` is handled, the `exn:break?` handler is never called, the server 
no longer responds to `Ctrl+C`, and (in this example) it eventually exits with 
status `1`.

I cannot figure out why. As far as I can tell, this should always handle 
`Ctrl+C` by exiting with 120.

> #lang racket/base
> 
> (let loop ([n 0])
>   (with-handlers ([exn:break? (lambda _ (exit 120))]
>   [void
>(lambda (exn)
>  (printf "handled error: ~a~n" (exn-message exn))
>  (loop (add1 n)))])
> (displayln n)
> (sleep 1)
> (cond
>   [(zero? n) (error 'foo)]
>   [(= n 5) (exit 1)])
> (loop (add1 n

-- 
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/YV%2BSWNpldfOB5tA3%40williamjbowman.com.


[racket-users] racket/gui/base in sandboxes in places

2021-10-03 Thread &#x27;William J. Bowman&#x27; via Racket Users
I'm trying to run sandboxes in places, but when the sandboxes need access to 
racket/gui (such as through 2htdp/universe), they get `cannot instantiate 
racket/gui/base' a second time`. I've tried initing racket/gui once in the 
server that starts the places, but this doesn't seem to work. (gui-available?) 
is still false in started places, and they still raise the exception when the 
sandbox tries to load the gui module.

I don't really need to run gui code in the sandbox, so I'm guessing the best 
workaround is to override `2htdp/universe` in the sandbox.

Anyone have either a solution, or a better workaround?

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


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

2021-09-21 Thread &#x27;William J. Bowman&#x27; 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.


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

2021-09-19 Thread &#x27;William J. Bowman&#x27; 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 a

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

2021-09-18 Thread &#x27;William J. Bowman&#x27; 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.
> > > >
> > > > Anecdota

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

2021-09-18 Thread &#x27;William J. Bowman&#x27; 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

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

2021-09-18 Thread &#x27;William J. Bowman&#x27; 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 &#x27;William J. Bowman&#x27; 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.


[racket-users] PLDI 2022 First Call for Papers

2021-09-08 Thread &#x27;William J. Bowman&#x27; 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.


Re: [racket-users] Questions about multiple Racket installations...

2021-04-14 Thread &#x27;William J. Bowman&#x27; via Racket Users
I use this: https://github.com/takikawa/racket-dev-goodies

When I need to switch, I just change PLTHOME to the right directory.

--
William J. Bowman

On Wed, Apr 14, 2021 at 11:06:15AM -0700, Don Green wrote:
>  I have several versions of Racket installed. 
> Is there a way to switch between using one version and another? Example: 
> use Racket 8
> then switch back to using Racket 7.
> 
> If there is no point in going back to a previous version, is there merit in 
> removing older versions.
> Thanks.  Don.
> 
> -- 
> 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/fcf25a75-cfe3-4ece-a65b-df55592845ean%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/YHdnLNIuNC24DLNM%40williamjbowman.com.


Re: [racket-users] A dict? question

2021-02-27 Thread &#x27;William J. Bowman&#x27; via Racket Users
Exactly. `'e` is a reader macro that gets read as `(quote e)`.
When it's already under a quote, the quoted quote is treated as a symbol:

> (dict-ref '('yay) 'quote)
'(yay)
> (quote ((quote yay)))
'('yay)
> '((quote yay))
'('yay)
> (dict-ref '((quote yay)) 'quote)
'(yay)

--
William J. Bowman

On Sun, Feb 28, 2021 at 01:45:56AM +0200, Yury Bulka wrote:
> Indeed,
> 
> > (dict-keys '('yay))
> '(quote)
> > (dict-values '('yay))
> '((yay))
> > (dict-ref '('yay) 'quote)
> '(yay)
> 
> So... this boils down to:
> 
> > (equal? '('yay) '((quote yay)))
> #t
> 
> --
> Yury Bulka
> https://mamot.fr/@setthemfree
> #NotOnFacebook
> 
> 
> 
> William J. Bowman  writes:
> 
> > try (dict-ref ‘(‘yay) ‘quote)
> 
> -- 
> 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/87k0qtf51n.fsf%40privacyrequired.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/YDraI2UWIH3ejIN3%40williamjbowman.com.


Re: [racket-users] A dict? question

2021-02-27 Thread &#x27;William J. Bowman&#x27; via Racket Users
try (dict-ref ‘(‘yay) ‘quote)

-- 
Sent from my phoneamajig

> On Feb 27, 2021, at 15:31, Yury Bulka  wrote:
> 
> Dear Racketeers,
> 
> I have noticed something I don't understand:
> 
>> (dict? '(yay))
> #f
>> (dict? '('yay))
> #t
>> (dict-ref '('yay) 'yay)
> ; dict-ref: no value for key: 'yay in: '('yay)
> 
> I'm puzzled - what makes '('yay) a dict compared to '(yay)?
> 
> (Running Racket 7.8 on Linux).
> 
> --
> Yury Bulka
> https://mamot.fr/@setthemfree
> #NotOnFacebook
> 
> 
> -- 
> 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/87mtvpf5pa.fsf%40privacyrequired.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/B540457B-D95F-4C18-A978-90033951BA0C%40williamjbowman.com.


[racket-users] When are rackunit tests delayed? (different between 7.8 and 8)

2021-02-22 Thread &#x27;William J. Bowman&#x27; via Racket Users
Below is an example that behaves "correctly", as in all tests run and are
counted as failured or errors correctly, in Racket 7.8, but which crashes in
Racket 8.

> #lang racket
> 
> (require
>  rackunit
>  rackunit/log)
> 
> (define (suite1)
>   (test-suite
>""
>(test-begin
>  (check-not-equal? (error "actual") (error "expected")
> 
> (define (suite2)
>   (test-suite
>""
>(check-not-equal? (error "actual") (error "expected"
> 
> (module+ test
>   (require rackunit/text-ui)
> 
>   ;; Correctly counts the tests as errors in 7.8 and 8.0
>   (check-pred
>integer?
>(run-tests (suite1)))
> 
>   ;; Counts the tests as errors in 7.8, but crashes in 8.0
>   (check-pred
>integer?
>(run-tests (suite2)))
>
>   ;; Gets run in 7.8, but not in 8.0
>   (check-equal? 0 0))

This has something to do with when test-suite delays a test, which seems
inconsistent across the Racket versions.
I'm not sure whether the problem was some undefined behaviour in test-suite or
not.

I'm a bit confused about the semantics of test-suites and tests, since the
documentation claims a test (unlike a check) is delayed, yet test-case and
test-begin do not delay tests, while test-suite does produce a delayed suite of
tests.
However, test-begin DOES seem to delay a test in the context of a test-suite.

I'd appreciate any insight.

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


[racket-users] Sticky scrollable nav bar in docs

2021-02-17 Thread &#x27;William J. Bowman&#x27; via Racket Users
One of my students asked about making the Racket docs navbar sticky and 
scrollable, to help when navigating very long docs pages. I made a quick hack 
and deployed it here:
  https://www.students.cs.ubc.ca/~cs-411/docs/reference/sets.html

Personally I've found it very useful. Would this change make sense for the 
Racket docs generally? (With some polish by someone who is better at UX than 
me?)

To implement it, I just replaced `doc-site.css` with the following

.navsettop {
position: fixed;
z-index: 1;
background: #a7b0be;
height: auto;
}


.tocset {
position: fixed;
overflow-y: scroll;
height: 88%;
}

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


Re: [racket-users] Contracts for (partially) specifying dictionary key -> value-predicates

2021-01-30 Thread &#x27;William J. Bowman&#x27; via Racket Users
For the curious/eager, I've submitted a PR with my initial implementation 
redesigned along the lines of the discussion here:

https://github.com/racket/racket/pull/3670

--
William J. Bowman

On Sat, Oct 31, 2020 at 06:14:10PM -0400, Ben Greenman wrote:
> On 10/31/20, jackh...@gmail.com  wrote:
> > I'm not sure, but I have a feeling Ben's suggestion to make them functions
> > instead of macros wasn't about the performance implications of macros.
> 
> Right. I was only thinking that macros are hard to build on. But then,
> I can use dictof/proc here.
> 
> -- 
> 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/CAFUu9R7xVB7KTkBPms40qLLhqcqPhKB_gVVXeYKKAMH0V1-BRQ%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/YBYUq1U7dGGoW9ny%40williamjbowman.com.


Re: [racket-users] Using GraphViz inside of Scribble?

2021-01-28 Thread &#x27;William J. Bowman&#x27; via Racket Users
I realized I forgot to include this stub:

> (define (run-dot str format)
>   (define cmd (string-append "dot -y -T" format))
>   (match (process cmd)
> [(list stdout stdin pid stderr ctl)
>  (write-string str stdin)
>  (newline stdin)
>  (close-output-port stdin)
>  (cond [(eq? (ctl 'status) 'done-error) (error (port->string stderr))]
>[else stdout])]))

On Wed, Jan 27, 2021 at 09:42:16PM -0800, 'William J. Bowman' via Racket Users 
wrote:
> I've been using graphviz inside Scribble for a bit.
> I found the package a bit inflexible and didn't produce output to my liking, 
> so
> I just rolled my own 'dot->svg' for HTML output:
> 
> > (require (only-in xml cdata)
> >  scribble/html-properties)
> > (define (dot->svg . rest)
> >   (elem #:style
> > (style #f
> >(list
> > (xexpr-property
> >  (cdata #f #f (apply string-append (drop (port->lines 
> > (run-dot (apply string-append rest) "svg")) 3)))
> >  (cdata #f #f ""))
> 
> Example:
> > @dot->svg{
> > digraph {
> > 
> > node [ shape="box" ]
> > 
> > /* The Languages */
> > 
> > L0 [label="x64"];
> > L1 [label="elf64"];
> > 
> > /* The Passes */
> > 
> > edge [fontname="Courier"]
> > 
> > L0 -> L1 [label="nasm"];
> > }
> > }
> 
> --
> William J. Bowman
> 
> On Wed, Jan 27, 2021 at 09:37:51PM -0800, Sorawee Porncharoenwase wrote:
> > Here’s how to add graphviz to Pollen
> > <https://github.com/mbutterick/pollen-users/issues/46>. The same technique
> > can be used for Scribble, but you would want to use image
> > <https://docs.racket-lang.org/scribble/base.html?q=image#%28def._%28%28lib._scribble%2Fbase..rkt%29._image%29%29>
> > as the tag function. You might also need to use define-runtime-path
> > <https://docs.racket-lang.org/reference/Filesystem.html?q=define-runtime-path#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29>
> > .
> > 
> > On Wed, Jan 27, 2021 at 9:23 PM Tim Meehan  wrote:
> > 
> > > IMHO, Racket's documentation is the gold standard. I tell everyone I work
> > > with that we should document things this well.
> > > Until now, I haven't seen any room for potential improvements.
> > >
> > > Now, I like ASCII art as much as the next person, but when I was reading
> > > the documentation for the GUI class hierarchy, I remembered that there was
> > > a graphviz <https://github.com/pykello/racket-graphviz> package for
> > > Racket now.
> > > I'm no good with Scribble, but I bet that someone clever could add some
> > > automatic graphs to it without much trouble.
> > >
> > > I'm not much good at GraphViz either, but here is my take on the first two
> > > ASCII art diagrams. I just used "dot -Tpdf" to make the tests.
> > >
> > > --
> > > 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/CACgrOxKkeVxdMq9-94%2BX87oCmBKaY0XHg-Sq4yj-fPLy%2B6MYyg%40mail.gmail.com
> > > <https://groups.google.com/d/msgid/racket-users/CACgrOxKkeVxdMq9-94%2BX87oCmBKaY0XHg-Sq4yj-fPLy%2B6MYyg%40mail.gmail.com?utm_medium=email&utm_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/CADcuegstUJsYGjcm5C7_Hniw_%3DTvb69FyQa820JN4vP0kChD%2BA%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/YBJOuMD2v2n29%2BpY%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/YBNXArD5HRuk%2BSeL%40williamjbowman.com.


Re: [racket-users] Using GraphViz inside of Scribble?

2021-01-27 Thread &#x27;William J. Bowman&#x27; via Racket Users
I've been using graphviz inside Scribble for a bit.
I found the package a bit inflexible and didn't produce output to my liking, so
I just rolled my own 'dot->svg' for HTML output:

> (require (only-in xml cdata)
>  scribble/html-properties)
> (define (dot->svg . rest)
>   (elem #:style
> (style #f
>(list
> (xexpr-property
>  (cdata #f #f (apply string-append (drop (port->lines 
> (run-dot (apply string-append rest) "svg")) 3)))
>  (cdata #f #f ""))

Example:
> @dot->svg{
> digraph {
> 
> node [ shape="box" ]
> 
> /* The Languages */
> 
> L0 [label="x64"];
> L1 [label="elf64"];
> 
> /* The Passes */
> 
> edge [fontname="Courier"]
> 
> L0 -> L1 [label="nasm"];
> }
> }

--
William J. Bowman

On Wed, Jan 27, 2021 at 09:37:51PM -0800, Sorawee Porncharoenwase wrote:
> Here’s how to add graphviz to Pollen
> . The same technique
> can be used for Scribble, but you would want to use image
> 
> as the tag function. You might also need to use define-runtime-path
> 
> .
> 
> On Wed, Jan 27, 2021 at 9:23 PM Tim Meehan  wrote:
> 
> > IMHO, Racket's documentation is the gold standard. I tell everyone I work
> > with that we should document things this well.
> > Until now, I haven't seen any room for potential improvements.
> >
> > Now, I like ASCII art as much as the next person, but when I was reading
> > the documentation for the GUI class hierarchy, I remembered that there was
> > a graphviz  package for
> > Racket now.
> > I'm no good with Scribble, but I bet that someone clever could add some
> > automatic graphs to it without much trouble.
> >
> > I'm not much good at GraphViz either, but here is my take on the first two
> > ASCII art diagrams. I just used "dot -Tpdf" to make the tests.
> >
> > --
> > 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/CACgrOxKkeVxdMq9-94%2BX87oCmBKaY0XHg-Sq4yj-fPLy%2B6MYyg%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/CADcuegstUJsYGjcm5C7_Hniw_%3DTvb69FyQa820JN4vP0kChD%2BA%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/YBJOuMD2v2n29%2BpY%40williamjbowman.com.


Re: [racket-users] Why is my sandbox trying to access /etc/ssl/certs.pem?

2021-01-04 Thread &#x27;William J. Bowman&#x27; via Racket Users
Ah! I didn’t know about the module browser, thanks! And I guess this chain 
makes sense.

-- 
Sent from my phoneamajig

> On Jan 4, 2021, at 16:27, Robby Findler  wrote:
> 
> 
> If you open a file that requires scribble/manual with the module browser 
> (available via the Racket menu item in DrRacket), you'll see that ssl is 
> needed by the code that opens urls (presumably to do https) which is needed 
> by the code that handles planet requires (since planet requires may involve 
> http requests) which is needed by the code that handles tags (presumably 
> these tags go via require paths, maybe?) in scribble. At least, I think I 
> might be getting that right.
> 
> Robby
> 
> 
>> On Mon, Jan 4, 2021 at 6:15 PM Sage Gerard  wrote:
>> I don't know if Scribble needs OpenSSL, but a dependency probably does. The 
>> only precondition of that error is that openssl/mzssl appears *somewhere* 
>> among the dependencies. I run into that same error for evaluators that have 
>> nothing to do with Scribble.
>> 
>> ~slg
>> 
>> ‐‐‐ Original Message ‐‐‐
>> On Monday, January 4, 2021 7:10 PM, 'William J. Bowman' via Racket Users 
>>  wrote:
>> 
>> > Thanks for the explanation.
>> >
>> > I can't figure out why scribble/manual needs openssl, but oh well.
>> >
>> > After reading through openssl, I've gone with a slightly less blunt 
>> > instrument:
>> >
>> > > (require/expose openssl/mzssl (X509_get_default_cert_file))
>> > > ...
>> > > [sandbox-path-permissions (append `((exists
>> > > ,(X509_get_default_cert_file)))
>> > > (sandbox-path-permissions))]
>> > > ...
>> >
>> > --
>> >
>> > William J. Bowman
>> >
>> > On Tue, Jan 05, 2021 at 12:07:12AM +, Sage Gerard wrote:
>> >
>> > > Heads up: My earlier example was missing a closing paren. Also just saw 
>> > > that your subject line asked "Why", so I checked.
>> > > openssl/mzssl provides a parameter called `ssl-default-verify-sources'. 
>> > > See 1. The parameter is created during module instantiation with a 
>> > > OS-dependent default value.
>> > > When you create a sandboxed evaluator, it is impacted by several 
>> > > parameters. The default values of those parameters have little to no 
>> > > trust in the code, and will deny ALL filesystem access. Also, all Racket 
>> > > modules that are not shared with the evaluator are instantiated again. 
>> > > So you need to account for what happens as a side effect of all 
>> > > instantiations needed to get the evaluator up and running. If some 
>> > > module somewhere happens to require openssl/mzssl (even if you don't 
>> > > need it), then you are impacted by the permissions on the evaluator.
>> > > My earlier example was crude precisely because it is a blanket grant of 
>> > > existential checks for all filesystem paths. For better security habits, 
>> > > you can just add one `exists' permission to`(sandbox-path-permissions)' 
>> > > based on the value of `(ssl-default-verify-sources)'.
>> > > ~slg
>> > > ‐‐‐ Original Message ‐‐‐
>> > > On Monday, January 4, 2021 6:53 PM, Sage Gerard s...@sagegerard.com 
>> > > wrote:
>> > >
>> > > > If you just want to silence the error with a blunt instrument, then 
>> > > > you could
>> > > > try a parameterization where sandbox-path-permissions is set to:
>> > > > (append (map (λ (p) `(exists ,p)) (filesystem-root-list)
>> > > > (sandbox-path-permissions)))
>> > > > This suffices since it is an existential check, not a file read.
>> > > > ~slg
>> > > > ‐‐‐ Original Message ‐‐‐
>> > > > On Monday, January 4, 2021 6:47 PM, 'William J. Bowman' via Racket 
>> > > > Users racket-users@googlegroups.com wrote:
>> > > >
>> > > > > I have a sandbox that loads scribble/manual (indirectly) to render 
>> > > > > some HTML.
>> > > > > But it crashes with the following error:
>> > > > >
>> > > > > > racket -e "(require racket/sandbox)" -e "((make-evaluator 
>> > > > > > 'racket/base) '(require scribble/manual))"
>> > > > >
>> > > > > file-exists?: `exists' access denied for /etc/ssl/cer

Re: [racket-users] Why is my sandbox trying to access /etc/ssl/certs.pem?

2021-01-04 Thread &#x27;William J. Bowman&#x27; via Racket Users
Thanks for the explanation.

I can't figure out why scribble/manual needs openssl, but oh well.

After reading through openssl, I've gone with a slightly less blunt instrument:

> (require/expose openssl/mzssl (X509_get_default_cert_file))
>
> ...
> [sandbox-path-permissions (append `((exists
>  ,(X509_get_default_cert_file)))
>   (sandbox-path-permissions))]
> ...

--
William J. Bowman

On Tue, Jan 05, 2021 at 12:07:12AM +, Sage Gerard wrote:
> Heads up: My earlier example was missing a closing paren. Also just saw that 
> your subject line asked "Why", so I checked.
> 
> openssl/mzssl provides a parameter called `ssl-default-verify-sources'. See 
> [1]. The parameter is created during module instantiation with a OS-dependent 
> default value.
> 
> When you create a sandboxed evaluator, it is impacted by several parameters. 
> The default values of those parameters have little to no trust in the code, 
> and will deny ALL filesystem access. Also, all Racket modules that are not 
> shared with the evaluator are instantiated again. So you need to account for 
> what happens as a side effect of all instantiations needed to get the 
> evaluator up and running. If some module somewhere happens to require 
> openssl/mzssl (even if you don't need it), then you are impacted by the 
> permissions on the evaluator.
> 
> My earlier example was crude precisely because it is a blanket grant of 
> existential checks for all filesystem paths. For better security habits, you 
> can just add one `exists' permission to `(sandbox-path-permissions)' based on 
> the value of `(ssl-default-verify-sources)'.
> 
> [1]: 
> https://docs.racket-lang.org/openssl/index.html?q=ssl-default-verify-sources#%28def._%28%28lib._openssl%2Fmain..rkt%29._ssl-default-verify-sources%29%29
> 
> 
> 
> ~slg
> 
> ‐‐‐ Original Message ‐‐‐
> On Monday, January 4, 2021 6:53 PM, Sage Gerard  wrote:
> 
> > If you just want to silence the error with a blunt instrument, then you 
> > could
> > try a parameterization where sandbox-path-permissions is set to:
> >
> > (append (map (λ (p) `(exists ,p)) (filesystem-root-list)
> > (sandbox-path-permissions)))
> >
> > This suffices since it is an existential check, not a file read.
> >
> > ~slg
> >
> > ‐‐‐ Original Message ‐‐‐
> > On Monday, January 4, 2021 6:47 PM, 'William J. Bowman' via Racket Users 
> > racket-users@googlegroups.com wrote:
> >
> > > I have a sandbox that loads scribble/manual (indirectly) to render some 
> > > HTML.
> > > But it crashes with the following error:
> > >
> > > > racket -e "(require racket/sandbox)" -e "((make-evaluator 'racket/base) 
> > > > '(require scribble/manual))"
> > >
> > > file-exists?: `exists' access denied for /etc/ssl/cert.pem
> > > errortrace...:
> > > context...:
> > > do-error
> > > security-guard-check-file
> > > ->host
> > > file-exists?
> > > /racket/racket/collects/openssl/mzssl.rkt:397:0: x509-root-sources
> > > interpret
> > > [repeats 1 more time]
> > > proc
> > > call-in-empty-metacontinuation-frame
> > > body of "/racket/racket/collects/openssl/mzssl.rkt"
> > > interpret-expr
> > > body of top-level
> > > run-module-instance!
> > > [repeats 12 more times]
> > > perform-require!
> > > loop
> > > This is strange, since openssl shouldn't actually be needed.
> > > I could just allow access to the file, but the path depends on which 
> > > operating system I'm running on making this slightly complicated, and the 
> > > access isn't necessary.
> > > Is there some way to trick Racket into not trying to do this, or else 
> > > some parameter I can use to provide access to whatever openssl is going 
> > > to try to touch without hardcoding the paths?
> > >
> > > 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/X/OpEPyvzOyzQql2%40williamjbowman.com.
> 
> 
> -- 
> You received this message because you are subscribed to th

[racket-users] Why is my sandbox trying to access /etc/ssl/certs.pem?

2021-01-04 Thread &#x27;William J. Bowman&#x27; via Racket Users
I have a sandbox that loads scribble/manual (indirectly) to render some HTML. 
But it crashes with the following error:
> racket -e "(require racket/sandbox)" -e "((make-evaluator 'racket/base) 
> '(require scribble/manual))"
file-exists?: `exists' access denied for /etc/ssl/cert.pem
  errortrace...:
  context...:
   do-error
   security-guard-check-file
   ->host
   file-exists?
   /racket/racket/collects/openssl/mzssl.rkt:397:0: x509-root-sources
   interpret
   [repeats 1 more time]
   proc
   call-in-empty-metacontinuation-frame
   body of "/racket/racket/collects/openssl/mzssl.rkt"
   interpret-expr
   body of top-level
   run-module-instance!
   [repeats 12 more times]
   perform-require!
   loop

This is strange, since openssl shouldn't actually be needed.

I could just allow access to the file, but the path depends on which operating 
system I'm running on making this slightly complicated, and the access isn't 
necessary.

Is there some way to trick Racket into not trying to do this, or else some 
parameter I can use to provide access to whatever openssl is going to try to 
touch without hardcoding the paths?

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


Re: [racket-users] PLT Redex & dependent type

2018-04-10 Thread &#x27;William J. Bowman&#x27; via Racket Users
FYI, I have some other models here:
 - A model of Luo's ECC, a much smaller model than CIC: 
https://github.com/wilbowma/ecc-redex
 - A couple of experimental models, including a model with just Π, and failed 
attempt (IIRC) to model
   Hoare Type Theory: https://github.com/wilbowma/dep-types-101

--
William J. Bowman

On Tue, Apr 10, 2018 at 07:53:37AM -0400, 'William J. Bowman' via Racket Users 
wrote:
> Yes. https://github.com/wilbowma/cic-redex
> 
> This isn't exactly a minimal example; I have a smaller model somewhere I'll 
> try to send.
> 
> -- 
> Sent from my phoneamajig
> 
> > On Apr 10, 2018, at 06:32, Ning Shan  wrote:
> > 
> > Can I implement dependent type in PLT Redex? 
> > https://en.wikipedia.org/wiki/Dependent_type 
> > 
> > Specifically Pi  type.
> > 
> > Can anyone give me a reference or a minimal example? Thanks in advance. :-)
> > -- 
> > 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.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] PLT Redex & dependent type

2018-04-10 Thread &#x27;William J. Bowman&#x27; via Racket Users
Yes. https://github.com/wilbowma/cic-redex

This isn't exactly a minimal example; I have a smaller model somewhere I'll try 
to send.

-- 
Sent from my phoneamajig

> On Apr 10, 2018, at 06:32, Ning Shan  wrote:
> 
> Can I implement dependent type in PLT Redex? 
> https://en.wikipedia.org/wiki/Dependent_type 
> 
> Specifically Pi  type.
> 
> Can anyone give me a reference or a minimal example? Thanks in advance. :-)
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] how can I approximate syntax properties with `make-rename-transformer`?

2017-11-30 Thread &#x27;William J. Bowman&#x27; via Racket Users
Also, I don't seem to have recorded this anywhere, but I recall that setting
the syntax-property 'not-free-identifier=? helped with this or a related
problem regarding syntax-properties across module boundaries.
  
https://docs.racket-lang.org/reference/stxtrans.html#%28def._%28%28quote._~23~25kernel%29._make-rename-transformer%29%29

On Thu, Nov 30, 2017 at 11:21:12AM +0100, 'William J. Bowman' via Racket Users 
wrote:
> > I can wrap the property around the target identifier, but the syntax 
> > property doesn't stick:
> > 
> > (provide (rename-out [mb #%module-begin]))
> > (define-syntax mb (make-rename-transformer (syntax-property 
> > #'other-module-begin 'foo "bar")))
> > (define-syntax other-module-begin (λ (stx) #'foo))
> We've seen this problem before.
> It has to do with module boundaries and how syntax properties are preserved.
>   https://groups.google.com/d/msg/racket-users/ZWjpz3kFmjo/SUXGVM3YEAAJ
> 
> It's been a while since I wrote this, but the work around I used was 
> exporting the identifier that *expanded into code* that inserted the syntax 
> property.
> This way, ths property doesn't need to be preserve, since it gets inserted 
> every time it is used:
> > The workaround seems to be: if you want to stash an identifier in a 
> > syntax-property, expand into syntax that attaches the syntax-property. That 
> > is, don't do (define x (syntax-property #'id 'prop #'stx)) and then use x 
> > in a syntax object, but generate #`(... (syntax-property #'id 'prop #'stx 
> > ...)) 
> 
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] how can I approximate syntax properties with `make-rename-transformer`?

2017-11-30 Thread &#x27;William J. Bowman&#x27; via Racket Users
> I can wrap the property around the target identifier, but the syntax property 
> doesn't stick:
> 
> (provide (rename-out [mb #%module-begin]))
> (define-syntax mb (make-rename-transformer (syntax-property 
> #'other-module-begin 'foo "bar")))
> (define-syntax other-module-begin (λ (stx) #'foo))
We've seen this problem before.
It has to do with module boundaries and how syntax properties are preserved.
  https://groups.google.com/d/msg/racket-users/ZWjpz3kFmjo/SUXGVM3YEAAJ

It's been a while since I wrote this, but the work around I used was exporting 
the identifier that *expanded into code* that inserted the syntax property.
This way, ths property doesn't need to be preserve, since it gets inserted 
every time it is used:
> The workaround seems to be: if you want to stash an identifier in a 
> syntax-property, expand into syntax that attaches the syntax-property. That 
> is, don't do (define x (syntax-property #'id 'prop #'stx)) and then use x in 
> a syntax object, but generate #`(... (syntax-property #'id 'prop #'stx ...)) 

--
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Intro and projects inquiry

2017-10-11 Thread &#x27;William J. Bowman&#x27; via Racket Users
Eric,

I don’t mean to inadvertently kill any conversations, but I wanted to point out 
that there is an existing list of Racket projects on the Racket GitHub wiki:
  https://github.com/racket/racket/wiki/Intro-Projects

It hasn’t seen an update in a while, so some of those may be solved or have 
others working on them, but if you’re looking for projects I’d start by looking 
there.

—
William J. Bowman

> On Oct 11, 2017, at 10:12 PM, Eric Griffis  wrote:
> 
> Hello,
> 
> My name is Eric and I love Racket.
> 
> I am 39 years old and have been writing software for 30 years. I studied 
> metaprogramming and taught programming languages as a grad student. My sole 
> academic publication is on semantics and provenance for distributed data 
> science tools. These days, I teach elementary school kids why and how to care 
> about "coding," which means so much more than just banging out text.
> 
> Racket is special to me because it makes programming fun again. When it's 
> time to get real work done, I want more people to reach for Racket first. 
> This is my goal, so I'm making this call for projects or project ideas as a 
> conversation starter.
> 
> Does a killer app or library sorely need a Racket alternative?
> 
> Do you dread certain tasks that have you reaching for Python or JavaScript, 
> or worse?
> 
> Is your professional community holding out on adopting Racket, and do you 
> know why?
> 
> Any amazing projects pitched at the conference?
> 
> I enjoyed following the graph drawing thread a few weeks ago. A serious 
> attempt at "better than graphviz" could be fun and worthwhile.
> 
> Eric
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Defining things in two phases at once

2017-07-03 Thread &#x27;William J. Bowman&#x27; via Racket Users
You can use 'module' to define a sub module in the same file, then import the 
function at both phases as you would from another file. See the docs for the 
module form. E.g.

#lang racket

(module racket A
 (provide foo)
 ...
)

(require (submod 'A) (for-syntax (submod 'A))

-- 
Sent from my phoneamajig

> On Jul 4, 2017, at 00:32, Sam Waxman  wrote:
> 
> Hello,
> 
> I have a function, foo, that I define in a file, and then use later on in 
> that file in multiple other functions. In some of the functions, I need foo 
> at phase 0. In others, I need it at phase 1.
> 
> Is there a way to define foo in both phases at once, or do you need to copy 
> and paste the definition, once with define and once with define-for-syntax?
> 
> I could of course define it in another file and export it in both phases, but 
> it truthfully belongs in the same file as the other things I'm using it for.
> 
> Thanks in advance!
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Redex: difficulty with #refers-to

2017-06-27 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Tue, Jun 27, 2017 at 07:21:48PM -0500, Robby Findler wrote:
> On Tue, Jun 27, 2017 at 3:23 PM, 'William J. Bowman' via Racket Users
>  wrote:
> > (Unfortunately, there is a known bug in Redex that #...bind is 
> > undocumented, so you had no way to know about this)
> 
> I agree that #:...bind is complex and the documentation is not ideal,
> but I believe you helped me improve it, so I'm not that known bug is
> really the most helpful reply here. Perhaps a pointer to the docs is
> better. Here it is:
> 
> https://plt.eecs.northwestern.edu/snapshots/current/doc/redex/The_Redex_Reference.html#%28form._%28%28lib._redex%2Freduction-semantics..rkt%29._define-language%29%29
Oh I didn't realize that documentation was live already. Should the bug be 
closed?
(this should probably go off-list)

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Redex: difficulty with #refers-to

2017-06-27 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Tue, Jun 27, 2017 at 09:21:59AM -0700, Justin Pombrio wrote:
> I'm trying to define a language in Redex that includes a list of top-level 
> function definitions:
> 
>   (p ::= 
> (prog (defun (x x) e) ... e))
> 
> And all function names should be in scope in all function bodies (other 
> things should be in scope as well, but I'm ignoring them here for simplicity):
> 
>   (prog (defun (x_fun x_param) e_body #:refers-to (shadow x_fun ...)) ...
> e_main))
This looks ill-formed to me. Inside e_body, there is only one x_fun bound, so 
x_fun ... doesn't make
sense.
This would make sense if you had a multi-argument functions, e.g.,
   (prog (defun (x_fun x ...) e_body #:refers-to (shadow x ...)) ...
 e_main))

You're trying to express a more complicated binding pattern than merely a list 
of binders.
This is expressing that each definition d inside (prog d ...) exports a name 
that is bound for all other definitions.
You need #:exports.
Maybe something like
   (defun (x_fun x ...) e_body #:refers-to (shadow x ...)) #:exports x_fun
   (prog d #:...bind (defs d (shadows defs d

This may not be quite right yet.

(Unfortunately, there is a known bug in Redex that #...bind is undocumented, so 
you had no way to know about this)

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Is there a (#%variable-value ...) macro like there are for #%datum, #%app, etc?

2017-06-20 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Tue, Jun 20, 2017 at 11:44:57AM -0700, Sam Waxman wrote:
> Hey all,
> 
> Is there a wrapper like this that works for determining the values that are 
> bound to variables?
...
> I've achieved similar functionality by binding identifiers to identifier 
> macros, but it would be much simpler and cleaner if there were a 
> #%variable-value to use.
I don't think there is a better, but I really want such a feature.
I've implemented a couple #langs and handling variable lookups this way has 
always felt like a cludge to me.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] RacketCon Code of Conduct

2017-06-18 Thread &#x27;William J. Bowman&#x27; via Racket Users
If men were angels... +1 for a CoC.

On Sat, Jun 17, 2017 at 09:50:53PM +0300, Matthias Felleisen wrote:
> 
> A code of conduct is a totally stupid idea for RacketCon. Racketeers were 
> raised properly by their parents and are well behaved. I really hate 
> attending conferences that need to impose a 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] How do I debug scope-manipulating code

2017-05-01 Thread &#x27;William J. Bowman&#x27; via Racket Users
Does anyone have advice on how to debug scope-manipulating meta-programs?
I'm not talking about the little 5 line example macros shown in the docs, but 
thousands of lines of
meta-programming that intentionally manipulates binding, but sometimes 
apparently does it wrong.

Part of the problem is that I don't know of a way to unit test for (or specify 
with contracts) correct scopeyness.
All my tests pass.
When a program goes wrong it's large and complicated and I can't find a small 
counterexample.

My current method for debugging is to combine `racket/trace` and `debug-scopes` 
to trace smelly parts
of the code.
I then sprinkle `syntax-local-introduce` until the output looks more reasonable.
This makes me feel like setting fire to "sets of scopes" and using gensym.
Also, it doesn't seem to be working.

-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] How to check if a value is not false

2017-04-15 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Sat, Apr 15, 2017 at 07:16:49AM -0700, Angus wrote:
> I have a function that can return either false or a node.  I have to check 
> four permutations:
> 
> both nodes false,
> left node false, 
> right node valid, left node false
> both node valid
> 
> I am doing it using cond like this:
> 
> (define (lines t)
>   (cond [(and (false? (node-l t)) (false? (node-r t))) < thing>>]  ;; if no children
> [(and (false? (node-l t)) (not (node-r t)))  <>]  ;; 
> if left child only
> [(and (node-l t) (false? (node-r t))) <> ]  ;; if 
> right child only
> [else <> ]))  ;; if both children
This looks like it might be a homework assignment. What Matthew said is true, 
you can make this
shorter, but if your class encourages a specific explicit style then you should 
be explicit instead.

> the first cond line using and and false? works ok and the last cond line 
> using else works ok.  But how do I check for the middle two occurrences?
Any value that is not false in Racket is true. You can test for non-false 
values using any conditional
construct, like `if` or `cond`. The operator `not` changes any non-false value 
into false, and
false into true.


#lang racket
(define x 1)
(define y "Hello, World")
(define z false)

(displayln x)
(displayln (not x))
(displayln (not z))
(displayln (not (not z)))

(if x
(displayln x)
(displayln "This can't happen"))

(if y
(displayln y)
(displayln "This also can't happen"))

(cond
   [(and x y (not z))
(printf "~a and ~a and not ~a~n" x y z)]
   [else (displayln "This cannot happen either")])


-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Confused about syntax properties

2017-01-29 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Sun, Jan 29, 2017 at 10:06:30AM -0800, Matias Eyzaguirre wrote:
> Hullo all,
> 
> I'm messing around with syntax properties to try to get a feel for them, but 
> in one of my tests they aren't behaving the way I would expect them to.
> 
> In my example the output is #f 1 #f, when I would have thought it would be #f 
> 1 2. Why is the third result #f and not 2?
> 
> 
> #lang racket
> 
> (define-syntax (annotate stx)
>   (syntax-case stx ()
> [(_ val) ; read
>  (or (syntax-property #'val 'annotation) #'#f)]
> [(_ val ann) ; write
>  (syntax-property #'val 'annotation #'ann #t)]))
> 
> (annotate 4) ; -> #f
> 
> (annotate 1 6) ; -> 1
> 
> (annotate (annotate 4 2)) ; -> 2
Because annotation is a macro, it receives the syntax of the input, not the 
value of the input.
The outer call to annotate receives the value #'(annotate 4 2), which has no 
syntax property, and
hence returns #f.

Your code is roughly like writing:
(syntax-property #'4 'annotation) ; -> #f

(syntax-property #'1 'annotation 6 #t) ; -> #'1

(syntax-property #'(syntax-property #'4 'annotation 2 #t)) ; -> #f

Try this instead:

(define annotated (syntax-property #'4 'annotation 2))
(syntax-property annotated 'annotation)

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] syntax-property lost across module boundary (WAS: format-id doesn't preserve preserved?-edness of syntax-property?)

2016-12-15 Thread &#x27;William J. Bowman&#x27; via Racket Users
module, the attached binding information
> says "the current module being compiled". When compiling
> "format-id2.rkt", the attached binding information for that `#'id^`
> says "format-id1.rkt".
> 
> 
> To summarize, don't try to attach syntax objects as property values
> like that. I know this advice sounds ironic, given that the original
> use of properties was for syntax-valued keys like 'origin. Properties
> like 'origin are meant to be extracted from just-expanded programs,
> though, as opposed to used in a later compilation step. At the same
> time, those uses of properties are why we can't just make
> `syntax-property` reject property values that are syntax objects.
> 
> 
> At Tue, 13 Dec 2016 14:16:49 -0800, Alexis King wrote:
> > > On Dec 13, 2016, at 11:23 AM, 'William J. Bowman' via Racket Users
> > >  wrote:
> > > 
> > > Notice that #'x is not the same identifier as x, and thus does not
> > > have the same syntax-properties.
> > 
> > I’m not convinced this is correct.
> > 
> > If you insert println statements in the body of define^, inside the
> > with-syntax block, you get the following:
> > 
> >   (println (syntax-property #'x 'definition))
> >   (println (syntax-property-preserved? #'x 'definition))
> > 
> >   ; => #
> >   ; => #t
> > 
> > The syntax properties are definitely maintained in templates used
> > by `syntax`.
> > 
> > > Why does this issue only comes up across a file boundary? I suspect
> > > this has to do with the behavior of make-rename-transformer. Since
> > > #'x was not getting 'not-free-identifier=? correctly,
> > > make-rename-transformer was optimizing this away, although I thought
> > > I was preventing that.
> > 
> > This is more interesting, and it was my first instinct, too. For
> > that reason, I replaced uses of make-rename-transformer with uses
> > of make-variable-like-transformer from syntax/transformer, but the
> > behavior was the same, so I don’t think this has to do with
> > make-rename-transformer specifically. However, something more
> > interesting happens.
> > 
> > I changed the macro that define^ defines to insert some debugging
> > calls on macro invocation:
> > 
> >   (define-syntax (id stx)
> > (println (syntax-property #'x 'definition))
> > (println (syntax-property-preserved? #'x 'definition))
> > ((set!-transformer-procedure
> >   (make-variable-like-transformer #'x))
> >  stx))
> > 
> > The output of this is much more interesting. When running the source
> > module, format-id1.rkt, the result is as one would expect:
> > 
> >   ; => #
> >   ; => #t
> > 
> > However, when using the defined identifier from format-id2.rkt, the
> > result is different:
> > 
> >   ; => #f
> >   ; => #f
> > 
> > This is extremely interesting, since the first example demonstrates
> > that the syntax property is most definitely marked as preserved,
> > yet it gets lost by the time format-id2 tries to get at it, despite
> > the fact that it should be the same exact syntax object.
> > 
> > My guess as to what’s going on here is that the issue is not with
> > make-rename-transformer but with quote-syntax. The above program
> > expands into a macro definition that has (quote-syntax x) in it,
> > and the x has a preserved syntax property on it. However, that
> > property is not actually preserved, despite being marked as preserved.
> > This is different from other uses of preserved syntax properties
> > that attach their syntax properties to expressions in the resulting
> > program, rather than quoted pieces of syntax.
> > 
> > This feels very confusing, and it certainly feels like a bug, but
> > maybe Matthew has an explanation for this behavior that I don’t
> > currently understand?
> > 
> > Alexis
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Re: syntax-property lost across module boundary (WAS: format-id doesn't preserve preserved?-edness of syntax-property?)

2016-12-13 Thread &#x27;William J. Bowman&#x27; via Racket Users
After a debugging session with Leif, the problem is actually a user-error 
caused by sublte issues with macros-generating-macors:

In the failing case, I was generating the following

  (with-syntax ([x (format-id ...)])
#`(begin
(define x body)
(define-syntax id
  (make-rename-transformer #'x

Notice that #'x is not the same identifier as x, and thus does not have the 
same syntax-properties.

Why does this issue only comes up across a file boundary? I suspect this has to 
do with the behavior of make-rename-transformer. Since #'x was not getting 
'not-free-identifier=? correctly, make-rename-transformer was optimizing this 
away, although I thought I was preventing that.

--
William J. Bowman

PS: Thanks Leif!

On Mon, Dec 12, 2016 at 12:55:24PM -0500, 'William J. Bowman' via Racket Users 
wrote:
> Ah, thanks.
> 
> Anyone else have other ideas for problems using syntax-properties, or maybe 
> make-rename-transformers (with not-free-identifier=?), across modules?
> 
> --
> William J. Bowman
> 
> On Sun, Dec 11, 2016 at 07:54:29PM -0500, Alex Knauth wrote:
> > 
> > > On Dec 11, 2016, at 7:20 PM, 'William J. Bowman' via Racket Users 
> > >  wrote:
> > > 
> > > Before I file a bug report, I want to make sure something *else* isn't 
> > > going on.
> > 
> > It looks like "something else" is going on; according to 
> > syntax-property-preserved? it's still marked as preserved in the program 
> > below.
> > 
> > #lang racket
> > (require racket/syntax)
> > 
> > (define stx (syntax-property #'x 'my-prop 5 #t))
> > (syntax-property-preserved? stx 'my-prop)
> > ;=> #true
> > 
> > ;; transfer properties from stx
> > (define stx* (format-id #f "y" #:props stx))
> > (syntax-property-preserved? stx* 'my-prop)
> > ;=> #true
> > 
> > Alex Knauth
> > 
> > > In "format-id1.rkt" 
> > > (https://gist.github.com/wilbowma/247d15e0e0bed6b239584854e79b5015), I 
> > > define and export some identifiers with preserved syntax-properties. The 
> > > identifier "id" is created using format-id with #:props to attach a 
> > > syntax-property. The identifier "id2" is created using generate-temporary 
> > > and a syntax-property is attached manually. I also use these the 
> > > syntax-property in the same file. If I run or compile the file, no errors.
> > > 
> > > In "format-id2.rkt" 
> > > (https://gist.github.com/wilbowma/ed071343c8c651f3a78d690a4ab7a392), I 
> > > use the syntax-properties in exactly the same way. However, if I run or 
> > > compile the file, I get errors that indicate "id" is missing it's 
> > > syntax-property.
> > > 
> > > --
> > > William J. Bowman
> > > Northeastern University
> > > College of Computer and Information Science
> > 
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] Re: syntax-property lost across module boundary (WAS: format-id doesn't preserve preserved?-edness of syntax-property?)

2016-12-12 Thread &#x27;William J. Bowman&#x27; via Racket Users
Ah, thanks.

Anyone else have other ideas for problems using syntax-properties, or maybe 
make-rename-transformers (with not-free-identifier=?), across modules?

--
William J. Bowman

On Sun, Dec 11, 2016 at 07:54:29PM -0500, Alex Knauth wrote:
> 
> > On Dec 11, 2016, at 7:20 PM, 'William J. Bowman' via Racket Users 
> >  wrote:
> > 
> > Before I file a bug report, I want to make sure something *else* isn't 
> > going on.
> 
> It looks like "something else" is going on; according to 
> syntax-property-preserved? it's still marked as preserved in the program 
> below.
> 
> #lang racket
> (require racket/syntax)
> 
> (define stx (syntax-property #'x 'my-prop 5 #t))
> (syntax-property-preserved? stx 'my-prop)
> ;=> #true
> 
> ;; transfer properties from stx
> (define stx* (format-id #f "y" #:props stx))
> (syntax-property-preserved? stx* 'my-prop)
> ;=> #true
> 
> Alex Knauth
> 
> > In "format-id1.rkt" 
> > (https://gist.github.com/wilbowma/247d15e0e0bed6b239584854e79b5015), I 
> > define and export some identifiers with preserved syntax-properties. The 
> > identifier "id" is created using format-id with #:props to attach a 
> > syntax-property. The identifier "id2" is created using generate-temporary 
> > and a syntax-property is attached manually. I also use these the 
> > syntax-property in the same file. If I run or compile the file, no errors.
> > 
> > In "format-id2.rkt" 
> > (https://gist.github.com/wilbowma/ed071343c8c651f3a78d690a4ab7a392), I use 
> > the syntax-properties in exactly the same way. However, if I run or compile 
> > the file, I get errors that indicate "id" is missing it's syntax-property.
> > 
> > --
> > William J. Bowman
> > Northeastern University
> > College of Computer and Information Science
> 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] format-id doesn't preserve preserved?-edness of syntax-property?

2016-12-11 Thread &#x27;William J. Bowman&#x27; via Racket Users
Before I file a bug report, I want to make sure something *else* isn't going on.

In "format-id1.rkt" 
(https://gist.github.com/wilbowma/247d15e0e0bed6b239584854e79b5015), I define 
and export some identifiers with preserved syntax-properties. The identifier 
"id" is created using format-id with #:props to attach a syntax-property. The 
identifier "id2" is created using generate-temporary and a syntax-property is 
attached manually. I also use these the syntax-property in the same file. If I 
run or compile the file, no errors.

In "format-id2.rkt" 
(https://gist.github.com/wilbowma/ed071343c8c651f3a78d690a4ab7a392), I use the 
syntax-properties in exactly the same way. However, if I run or compile the 
file, I get errors that indicate "id" is missing it's syntax-property.

--
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] How to test that a file is syntactically correct, but don't run it

2016-11-26 Thread &#x27;William J. Bowman&#x27; via Racket Users
raco read or raco expand may be the closest to doing this without doing much 
else. 
https://docs.racket-lang.org/raco/read.html

Is there some way to e.g. hook some of DrRackets syntax checker up to a raco 
check-syntax? That would be convenient in the terminal.

-- 
Sent from my phoneamajig

> On Nov 26, 2016, at 01:28, David Storrs  wrote:
> 
> As part of my pre-checkin test suite I'd like to be able to check that all 
> files are syntactically correct, but I don't want to actually execute them 
> because, e.g. executing 'server.rkt' would start the server and I don't want 
> that.  Is there a way to do this?  Nothing I see under 'raco help' or the 
> racket docs suggests a solution.
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Matching on a prefab struct

2016-11-09 Thread &#x27;William J. Bowman&#x27; via Racket Users
What I'm doing: macros generating macros generating structs, and elimination 
forms those structs. Matching against a list of arbitrary fields is easier than 
keeping track of the actual fields.

struct->list might be what I want; thanks!

-- 
Sent from my phoneamajig

> On Nov 9, 2016, at 19:23, Jack Firth  wrote:
> 
> I'm not 100% sure what you're attempting, but it looks like you're 
> duplicating the behavior of `struct->list`. If you wish to pattern-match on a 
> struct as if it were a list you could use the `app` match expander:
> 
>> (struct posn-3d (x y y))
>> (match (posn-3d 1 2 3)
>[(app struct->list (list-rest x other))
> (apply posn-3d x (reverse other)))
> (posn-3d 1 3 2)
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Matching on a prefab struct

2016-11-09 Thread &#x27;William J. Bowman&#x27; via Racket Users
The following simple example does not behave as expected on my machine. Am I 
expecting wrong or is the machine behaving wrong?

```
#lang racket

(struct meow (e) #:prefab)

(require racket/match)

(match #s(meow 1)
  [`#s(meow ,@(list-rest a))
   a])
```

Expected behavior: return (list 1)
Observed behavior: error, "a: unbound identifier in module"

-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] syntax-parse #:with and error messages

2016-09-29 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Thu, Sep 29, 2016 at 04:06:21PM -0400, 'William J. Bowman' via Racket Users 
wrote:
> being printed as #%app, and only now understand (thanks Alex!) what's really 
> going on here.
Correction: Thanks Alex*is*.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] syntax-parse #:with and error messages

2016-09-29 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Thu, Sep 29, 2016 at 12:23:16PM -0400, Ryan Culpepper wrote:
> >  ; /tmp/test.rkt:29.0: my-let: expected the identifier `begin'
> >  ;   at: quote
> >  ;   in: (my-let ((x 5)) x)
> >  ; Context: 
> >
...
> The `quote` is coming from the local expansion:
...
> Meanwhile, you can also fall back to printf debugging using #:do
> side-clauses.
I did eventually figure out where the quote was coming from using printf 
debugging. The problem was I had no
idea where to start, because in a larger context with more complex macros it is 
really unclear why
"begin" was expected but "quote" was found in the expression "(my-let ((x 5)) 
x)", which does not
contain "quote" and does not use "begin" at the top-level pattern.
I think I would have had a lot less trouble debugging if the error message had 
said something about a
"#:with" pattern, or something that indicated it wasn't expected in the 
"(my-let ((x 5)) x)" directly
but in some refinement of the pattern.


> Would something like `debug-syntax-parse!` extended with Alex's proposal
> (https://github.com/racket/racket/issues/1377) for more debugging information
> have helped?
That looks great. Although, I also didn't know about "debug-syntax-parse!".

> >  ; /tmp/test.rkt:29.0: my-let: expected the identifier `lambda
> >  ;   at: lambda
> >  ;   in: (my-let ((x 5)) x)
> >  ; Context: 
> >
> >So, we expected to see identifier that is there?
> >That's a strange error.
...
> I'll see if I can squeeze it into the error message that the identifier was
> expected to have a different binding.
I think this is an instance of larger problem; I ran into a similar problem 
with #%plain-app
being printed as #%app, and only now understand (thanks Alex!) what's really 
going on here.
I don't think it's specific to syntax-parse.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] #%plain-app prints as #%app, hindering debugging

2016-09-28 Thread &#x27;William J. Bowman&#x27; via Racket Users
Consider the following program:

  #lang racket
  (require (for-syntax syntax/parse))

  (define (Type x) x)

  (begin-for-syntax
(define x (local-expand #`(Type 1) 'expression null))

(displayln x)

(displayln
 (syntax-parse x
   #:literals (Type #%app #%plain-app)
   [(#%app Type i)
1]
   [(#%plain-app Type i)
2])))

Naturally, I expect it to print:
  #
  1

But it doesn't:
  #
  2

-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] syntax-parse #:with and error messages

2016-09-28 Thread &#x27;William J. Bowman&#x27; via Racket Users
I recently ran into a problem that took me hours to diagnose.
It turns out that a `#:with` clause in a syntax-parse was not matching, but I 
would never have guessed
that from the error message I got.

Here is a simplified example:

  (define-syntax-rule (my-fancy-macro syn ...) (begin syn ...))

  (define-syntax (my-let syn)
(syntax-parse syn
  #:literals (begin)
  [(_ ([x e] ...) body)
   #:with (lambda (y ...) (begin e^ ...))
   (local-expand #`(lambda (x ...) (my-fancy-macro e ...)) 'expression null)
   #`((lambda (y ...) body) e^ ...)]))

  (my-let ([x 5]) x)
  ; /tmp/test.rkt:29.0: my-let: expected the identifier `begin'
  ;   at: quote
  ;   in: (my-let ((x 5)) x)
  ; Context: 

It's not clear where "quote" comes from; it doesn't appear in the syntax I've 
written
down or any of the patterns I've written, so it's totally useless for debugging.

It gets even worse when I remember I forgot to declare `lambda' as a literal:

  (define-syntax (my-let syn)
(syntax-parse syn
  #:literals (lambda begin)
  [(_ ([x e] ...) body)
   #:with (lambda (y ...) (begin e^ ...))
   (local-expand #`(lambda (x ...) (my-fancy-macro e ...)) 'expression null)
   #`((lambda (y ...) body) e^ ...)]))

  (my-let ([x 5]) x)
  ; /tmp/test.rkt:29.0: my-let: expected the identifier `lambda
  ;   at: lambda
  ;   in: (my-let ((x 5)) x)
  ; Context: 

So, we expected to see identifier that is there?
That's a strange error.
I'm not sure if this one is related, but it came up in the same debugging 
session.

Is there anything to be done about these error message?

-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] syntax-properties, local-expand, and a struct

2016-09-28 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Fri, Sep 23, 2016 at 02:58:23PM -0400, Ryan Culpepper wrote:
> It appears that the constructor macro (implemented by self-ctor-transformer
> in racket/private/define-struct.rkt) transfers the syntax properties from
> the macro use to its expansion (see the datum->syntax in the first
> syntax-case clause). Then the properties get duplicated because of the
> merging step described here:
> http://docs.racket-lang.org/reference/stxprops.html.
Ah, I totally missed the description of merging.
I thought there might be some merging logic, but didn't see it described under 
`syntax-property`.

So should all uses of syntax properties expect to sometimes get cons pairs of 
merged properties?

> Perhaps that datum->syntax shouldn't copy the properties over?
I defer to experts on this.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] syntax-properties, local-expand, and a struct

2016-09-23 Thread &#x27;William J. Bowman&#x27; via Racket Users
Under certain conditions, the value of a syntax property is duplicated.
I can't figure out why, or if this is a bug, and any advice would be 
appreciated.

I've attached the smallest program that generates this behavior that I've 
managed to find.

The conditions seem to be:

1. Write a syntax object that
  - represents an application of constructor for a struct to some value.
  - has an attached syntax property; suppose this property's key is 'x and 
value is '1.
  - does not manually use `#%app` to apply the constructor.
2. Use `local-expand` on a use of this macro.

Before using `local-expand`, the syntax object has a property 'x with value '1.
The result of `local-expand` will have a property 'x with a value of '(1 . 1).
If you manually use `#%app` to apply the constructor, or apply a procedure 
instead of a constructor,
then the result of `local-expand` will have a property 'x and a value of '1.

-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.
#lang racket/base
(require
 (for-syntax
  rackunit
  racket/base))

(struct test (val))

(define (id x) x)

(begin-for-syntax
  (define (my-expand syn)
(local-expand syn 'expression '()))

  (check-equal?
   (syntax-property (my-expand (syntax-property #`(test 1) 'test 1)) 'test)
   1)

  (check-equal?
   (syntax-property (my-expand (syntax-property #`(#%app test 1) 'test 1)) 
'test)
   1)

  (check-equal?
   (syntax-property (my-expand (syntax-property #`(id 1) 'test 1)) 'test)
   1))


signature.asc
Description: PGP signature


Re: [racket-users] Scribble: unnumbered and unindexed sections

2016-09-04 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Sun, Sep 04, 2016 at 11:50:21AM -0700, Shriram Krishnamurthi wrote:
> Is there a way to have unnumbered and unindexed section? (Yes, these are 
> different issues.)
> 
> It would be helpful to have unnumbered sections, à la \[sub]section* in LaTeX.
You can use `@section[#:style 'unnumbered]` for this.

See `raco doc part` for some of the relevant style names. I'm not sure, but one 
of them ('hidden ?) may help with unindexed.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Macros that use with-handlers

2016-07-16 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Sat, Jul 16, 2016 at 02:16:20PM -0400, David Storrs wrote:
> I saw the #:when keyword for patterns and thought that would do what I
> needed.  The following code seems like it should work, but it doesn't.
> What am I missing?
> 
> 
> (define-syntax (throws stx)
>   (syntax-parse stx
> [(_ boom pred msg)
>  #:when (lambda () (procedure? #'pred))
To address the immediate problem, this `procedure?` test will always return 
`#f`, since `#'pred` is a
syntax object and not a procedure. You need to do `(procedure? (syntax->datum 
#'pred))`. Similarly
reasoning applies to the `string?` test.

I'm not sure your approach is ideal, but I'll let someone else comment.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] After font change, bounding box too high in Redex picts

2016-06-24 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Fri, Jun 24, 2016 at 12:14:39PM -0500, Robby Findler wrote:
> Did you trying using basic-text and the other nearby-documented
> parameters to add the inset you want? I think those ones might
> actually cover everything. Let me know if you can't get that to work.
I did not. I'll take a look, thanks.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] After font change, bounding box too high in Redex picts

2016-06-24 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Fri, Jun 24, 2016 at 11:47:45AM -0500, Robby Findler wrote:
> The current-render-pict-adjust functionality isn't really designed to
> work around your disagreements with font designers about how much
> space they put around letter forms. :)    or am I misinterpreting
> your comment? If that's really an accurate characterization, then you
> might actually try just hacking the font itself?
I don't think it's from the font. I'm using the (La)TeX math fonts---Computer 
Modern Unicode and Latin
Modern---which don't have all this extra space in LaTeX. On the other hand, I 
don't know much about
fonts and rendering, so maybe they do.

> As for current-render-pict-adjust, I can't really be sure without
> seeing some Redex code,
I made a little repo with bits of code I'm using: 
https://github.com/wilbowma/retex
But your theory seems to make sense.

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] After font change, bounding box too high in Redex picts

2016-06-24 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Thu, Jun 02, 2016 at 11:40:14PM -0400, 'William J. Bowman' via Racket Users 
wrote:
> Attached are two screenshots of part of a model I've extracted from Redex.
> 
> The first is after changing the default fonts. As you can see, there is a 
> *lot* of vertical whitespace
> around each judgment form clause and where clause. In particular, the top of 
> the bounding box seems
> too high.
> 
> The second is after using current-render-pict-adjust to add a negative inset 
> on everything.
> It is better, but does not seem to affect the where clauses.
FYI, I found that `current-render-pict-adjust` did not affect `where` clauses. 
By redefining
`where-combine`, too, to add a negative inset, I got the desired result without 
the extra whitespace.

Should `current-render-pict-adjust` affect `where-combine`, i.e., is this a bug?

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] After font change, bounding box too high in Redex picts

2016-06-02 Thread &#x27;William J. Bowman&#x27; via Racket Users
Attached are two screenshots of part of a model I've extracted from Redex.

The first is after changing the default fonts. As you can see, there is a *lot* 
of vertical whitespace
around each judgment form clause and where clause. In particular, the top of 
the bounding box seems
too high.

The second is after using current-render-pict-adjust to add a negative inset on 
everything.
It is better, but does not seem to affect the where clauses.

Is there something else I can do? I am going about this wrong?

--
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] ANN: A Redex model of CIC

2016-05-19 Thread &#x27;William J. Bowman&#x27; via Racket Users
To understand CIC, I have been working through the CIC spec. in the Coq 
reference manual and building a model in Redex.
The model is now fairly complete, and I thought it may be of interest to these 
two lists, so I put the
model on GitHub:

  https://github.com/wilbowma/cic-redex

Please free to study, improve, extend, or otherwise use it in anyway you see 
fit. If you find mistakes
in the model, please let me know so I can correct my understanding.

-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Compiler question

2016-04-27 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Wed, Apr 27, 2016 at 01:52:24PM -0600, Jerry Jackson wrote:
> I'd really be interested in how the two forms look when they've both been
> reduced to some canonical internal format.
You can use `raco expand` the result after macro expansion, and `raco decompile`
to look at the result of decompiling the bytecode.
If I understand correctly, the latter may include some optimizations,
but most optimizations are done by the JIT compiler.

E.g.
  > raco expand test.rkt | less
  > raco make test.rkt
  > raco decompile test.rkt | less

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Redex pattern for "sequence whose elements match this depth 0 pattern"?

2016-03-25 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Fri, Mar 25, 2016 at 07:05:52AM -0500, Robby Findler wrote:
> I think the right way to approach such questions is to start from a more
> realistic example and then ask "what do we want the typeset version of this
> to look like?".
I like this advice.
Unfortunate, I think I want the typeset version to look like the same
pattern variable in two places but at different depths.

For real example, I have a model of a dependent type system with
inductive type families.
To check that the declared inductive types are valid, I check that
  a) the declared constructors actually return the declared type
  b) the types of the constructors are strictly positive.

Here is a snippet:

(define-judgment-form tt-typingL
  #:mode (valid I)
  #:contract (valid Δ)

  [ "Valid-Empty"
   (valid ∅)]

  [(valid Δ)
   (type-infer Δ ∅ t_D U_D)
   (type-infer Δ (∅ D : t_D) t_c U_c) ...
   ;; NB: Ugh this should be possible with pattern matching alone 
   (side-condition ,(andmap (curry equal? (term D)) (term (D_0 ...
   ;; positive* should probably be a judgment so I can ... it
   (side-condition (positive* D (t_c ...)))
   - "Valid-Inductive"
   (valid (Δ (D : t_D
   ((c : (name t_c (in-hole Ξ (in-hole Θ D_0
...])

I would prefer to write as this as follows.
Notice the D_0 in the conclusion has changed to a D, and the
side-condition that escapes into Racket disappears.

(define-judgment-form tt-typingL
  #:mode (valid I)
  #:contract (valid Δ)

  [ "Valid-Empty"
   (valid ∅)]

  [(valid Δ)
   (type-infer Δ ∅ t_D U_D)
   (type-infer Δ (∅ D : t_D) t_c U_c) ...
   ;; positive* should probably be a judgment so I can ... it
   (side-condition (positive* D (t_c ...)))
   - "Valid-Inductive"
   (valid (Δ (D : t_D
   ((c : (name t_c (in-hole Ξ (in-hole Θ D
...])

In this instance, I suppose I could create a new judgment or
metafunction that checks each constructor's type separately w.r.t. D.
Since both instances would be at depth 0, this would be fine.
Maybe even easier to read..

--
William J. Bowman

PS: You cannot run this email :(

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] Redex pattern for "sequence whose elements match this depth 0 pattern"?

2016-03-24 Thread &#x27;William J. Bowman&#x27; via Racket Users
#lang scribble/doc Ha, you can run this email!

In Redex, I have on several occasions found myself trying to use a
pattern to constrain a sequence's member to match that pattern.
i.e., I want to use a pattern bound at depth 0 to constrain a pattern
at depth 1.
Unfortunately, I can't do this, so it seems I must escape into Racket
and enforce this constraint with andmap and equal?.
I'm hoping someone can tell me there is a better way.

For example:

@(require
  redex/reduction-semantics
  racket/function)

@(define-language testL
   [x ::= variable-not-otherwise-mentioned])

(define-judgment-form testL
  #:mode (complex-match I)
  #:contract (complex-match (x (x ...)))

   [-
(complex-match (x (x ...)))])

Gives this error:
; : define-judgment-form: found the same binder, x, at different depths, 0 
and 1
;   at: x
;   in: (x (x ...))

So, I am forced to write this:

@(define-judgment-form testL
  #:mode (complex-match_0 I)
  #:contract (complex-match_0 (x (x ...)))

  [;; NB: Ugh this should be possible with pattern matching alone 
   (side-condition ,(andmap (curry equal? (term x)) (term (x_0 ...
   -
   (complex-match_0 (x (x_0 ...)))])

@(require rackunit)
@(check-true
  (judgment-holds (complex-match_0 (x (x)
@(check-true
  (judgment-holds (complex-match_0 (foo (foo foo)
@(check-false
  (judgment-holds (complex-match_0 (x (y z))


This is particularly annoying, since I can easily do almost the
*opposite*, i.e., use a depth 0 pattern while constraining a sequence's
members to be distinct.

@(define-judgment-form testL
  #:mode (complex-not-match I)
  #:contract (complex-not-match (x (x ...)))

  [-
   (complex-not-match (x_!_0 (x_!_0 ...)))])

@(check-false
  (judgment-holds (complex-not-match (x (x)
@(check-false
  (judgment-holds (complex-not-match (foo (foo foo)
@(check-true
  (judgment-holds (complex-not-match (x (y z))


If there is no better way, would it be too much to ask for a new
pattern that does this? E.g., perhaps (x_=_0 (x_=_0 ...))?

-- 
William J. Bowman
Northeastern University
College of Computer and Information Science

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Documentation or examples for handin-server?

2016-03-23 Thread &#x27;William J. Bowman&#x27; via Racket Users
Once upon a time, I used the handin server for a course.
All the files I used are online.
It is not particularly well-documented, but may serve as reference code:
https://github.com/search?q=@wilbowma+cs2500&type=Repositories&ref=searchresults

--
William J. Bowman

On Wed, Mar 23, 2016 at 02:07:42PM -0700, mauero...@gmail.com wrote:
> I am trying to set up handin-server with the Grading Utilities.
> 
> I have read the official documentation, but I must be missing several points 
> because even when I just copy the checker.rkt function from the documentation 
> it does not work. ("submit error: checker: undefined; cannot reference an 
> identifier before its definition ...")
> 
> I see from old posts on the Racket mailing list that there are ways to change 
> the language to BSL, but I can't find further information about it.
> 
> I am looking for more elaborate examples, or a pointer to further reading 
> that I have missed. 
> 
> Thanks.
> 
> Andrew Mauer-Oats
> Whitney Young Magnet High School
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


pgpti8ZLaX0jd.pgp
Description: PGP signature


Re: [racket-users] How to shut down racket webserver without sudo kill?

2016-03-10 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Thu, Mar 10, 2016 at 03:26:28PM -0500, Marc Kaufmann wrote:
> In case you are wondering why I start the server with root privileges, it
> seems that I need those to listen to ports 80 and 443.
On Linux, you can use setcap to enable specific executable to bind low
ports even when running as non-root.
You could run `setcap 'cap_net_bind_service=+ep' /path/to/racket`.

For more details:
https://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-1024-on-l

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] Simple question on begin and call-by-value

2016-01-08 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Fri, Jan 08, 2016 at 12:58:14PM -0800, Eduardo Bonelli wrote:
> Hello,
> 
>  Why do the values of these two expressions differ?
> 
> > (begin (void))
> > ((lambda x (begin x)) (void))
> '(#)
> 
>  In the second case, I understand that CBV would evaluate the argument 
> "(void)" to obtain the (untyped) value "#". It then passes this on to 
> the function "((lambda x (begin x))", resulting in "(begin #)". So why 
> does this not evaluate to #?
((lambda x x) (void)) returns a list containing the void object. Perhaps you 
meant (lambda (x) (begin x))?

--
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] backwards incompatible change to redex: does it break your models?

2015-12-22 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Sun, Dec 20, 2015 at 08:42:25PM -0600, Robby Findler wrote:
> The reason the "E_1" and the "e_1" are treated differently is that the
> "e" is mentioned in "binding" position of the shortcut. That is what
> makes it special. Does this make sense?
Yes, thank you.

> (Have a read of the paragraph
> in the redex docs for reduction-semantics that talks about shortcuts
> and let me know if it makes more sense now and, even better, if you
> have any suggestions for edits!)

I read through the documentation at
http://pkg-build.racket-lang.org/doc/redex/The_Redex_Reference.html?q=reduction-relation#(mod-path._redex/reduction-semantics).
The closest paragraph I can see to talking about this seems out of date.

"Each shortcut clause defines arrow names in terms of base-arrow-name
and earlier shortcut definitions. The left- and right-hand sides of a
shortcut definition are identifiers, not patterns and terms. These
identifiers need not correspond to non-terminals in language."

Of course now, the last sentence requires s/need not/must not/. I would
also add a final sentence such as "Therefore, the output of the shortcut is
not checked against the syntax of any non-terminal."

> What if I were to actually make it do what people seem to think it
> does, in the case that the chosen name is a non-terminal? So, if you
> write a shortcut whose name is NOT a non-terminal, say "x" then it
> would be like you wrote "any_x". And if you used a non-terminal, then
> the shortcut would apply only when the expression actually matches the
> corresponding non-terminal. Redex would still have to insist that the
> parameters to the shortcuts are identifiers, but I could add in that
> restriction?
> 
> This is also backwards incompatible, but in a different way, tho. So
> that's slightly worrying. This form of backwards incompatibility has
> the downside that it will just make things stop reducing instead of
> getting a syntax error. So we'd have to like it a LOT to go this way.
The fact that it will cause previously good code to fail silently
is rather unacceptable. Although, I think this changed behavior is
preferable because it matches the behavior of much of the rest of Redex,
and matches what people seem to except.

Perhaps a different syntax for this changed version of shortcut, and
deprecating the current version?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


pgpoJU_ugC6C7.pgp
Description: PGP signature


Re: [racket-users] backwards incompatible change to redex: does it break your models?

2015-12-20 Thread &#x27;William J. Bowman&#x27; via Racket Users
I noticed this last week when I upgraded Redex for other reasons. It
broke one of my models, and I was momentarily confused. In fact, I
took the error message to mean I had somehow introduced an error and
spent some time staring at my tests to see if I had introduced a
syntax error. I only fixed the issue after investigating the git
commits to Redex.

It is a little confusing that, in this one place (AFAIK), I have to
arbitrary names rather than non-terminal names. It is also strange
that my context non-terminal do not trigger this error. That is, with
non-terminals E and e defined, [(--> (in-hole E e_0) (in-hole E e_1))
...] triggers an error while [(--> (in-hole E e0) (in-hole E e1))]
does not; perhaps this is just my misunderstanding of how
reduction-relation works.

--
William J. Bowman

On Sat, Dec 19, 2015 at 09:12:53AM -0600, Robby Findler wrote:
> I've recently pushed a change to Redex
> (https://github.com/racket/redex/commit/cbb2d88b) that disallows the
> names of non-terminals in shortcuts in reduction relations. I did this
> after seeing someone (quite reasonably!) assume that using a
> non-terminal there meant the shortcut would work only for terms
> matching those non-terminals, which is not how things actually work.
> 
> The upside of making this an error is that, instead of having to study
> the minutiae of the reduction-relation-relation construct in the docs,
> Redex users are told when they think redex is fancier than it is in
> this respect.
> 
> The downside is that this broke a bunch of old models I had lying
> around. I've fixed them (it's easy to do), but I worry that someone
> who gets out an old model to show it to someone will be greeted with
> this unexpected error message.
> 
> Any opinions on whether or not I should revert this commit?
> 
> Robby
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] How to make rackunit show tests succeeded?

2015-12-16 Thread &#x27;William J. Bowman&#x27; via Racket Users
On Wed, Dec 16, 2015 at 03:50:08PM -0800, David K. Storrs wrote:
> Hi folks,
> 
> I'm just getting started with rackunit, and I was very surprised when I found 
> that it simply emits nothing if a test succeeds.  Every other testing 
> framework I've used before will print "ok" (or etc) on a successful test, so 
> that you can differentiate between "the test succeeded" and "the test wasn't 
> run."
> 
> check-equal? returns  so I can't just wrap it in another function that 
> prints "ok" on success.  Is there a way to tell rackunit that I want to see 
> successes?
You might want `test-begin` to wrap a suite of many checks, with a print "ok" 
at the end of the suite. This would only be run if no tests fail: 
http://docs.racket-lang.org/rackunit/api.html#(form._((lib._rackunit/main..rkt)._test-begin)).

You could also use the parameter `current-check-handler` to print "ok" after 
*each* test: 
http://docs.racket-lang.org/rackunit/internals.html#(def._((lib._rackunit/main..rkt)._current-check-handler))

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] More concise testing in PLT Redex? (new redex-chk pkg)

2015-11-05 Thread &#x27;William J. Bowman&#x27; via Racket Users
Thanks, I've been meaning to do something about this for months!

Do they make use of `default-equiv`?

-- 
William J. Bowman

On Wed, Nov 04, 2015 at 05:50:01AM -0800, Andrew Kent wrote:
> Dear other PLT Redex users,
> 
> Do you have any clever tricks/tools to make testing in PLT Redex
> more palletable? I was finding some of my tests had a lot more
> boiler-plate text than actual test-relevant code. I would love to
> hear your thoughts/experiences on this issue... and share
> something I threw together that I've found helpful:
> 
> I basically hijacked and rewrote Jay's lovely rackunit/chk
> pkg (thanks Jay!) to cater to redex tests. It's now the
> 'redex-chk' pkg (on http://pkgs.racket-lang.org/).
> 
> It allows verbose tests like these:
> 
> (module+ test
>   ;; restrict tests
>   (test-equal (term (restrict mt-Γ Any Int)) (term Int))
>   (test-equal (term (restrict mt-Γ Int Any)) (term Int))
>   (test-equal (term (restrict mt-Γ Int Bool)) (term (U)))
>   (test-equal (term (restrict mt-Γ (U Bool Int) Int)) (term Int))
> 
>   ;; subtyping tests
>   (test-equal (judgment-holds (subtype mt-Γ Int Int)) #t)
>   (test-equal (judgment-holds (subtype mt-Γ Int Any)) #t)
>   (test-equal (judgment-holds (subtype mt-Γ Any Int)) #f))
> 
> to be written like this:
> 
> (module+ test
>   ;; restrict tests
>   (redex-chk
>(restrict mt-Γ Any Int) Int
>(restrict mt-Γ Int Any) Int
>#:= (restrict mt-Γ Int Bool) (U)
>[(restrict mt-Γ (U Bool Int) Int) Int])
> 
>   ;; subtyping tests
>   (redex-relation-chk
>subtype
>[mt-Γ Int Int]
>[mt-Γ Int Any]
>[#:f mt-Γ Any Int]))
> 
> (Note -- each of the restrict tests is checking for 'equal?',
>  there's just several equivalent ways to write that,
>  like in Jay's rackunit/chk lib)
> 
> Anyway - throwing this together was a fun macro-learning experience for
> me and I think has helped me write more and better tests for my
> redex model (now that it's easier). I figured it might be useful for 
> others, and wondered if anyone else had done anything in the same 
> department.
> 
> Best,
> Andrew
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] Contract error when installing Gregor

2015-11-03 Thread &#x27;William J. Bowman&#x27; via Racket Users
I get the following contract error when installed Gregor (the excellent
date and time library) on my machine.

Any one know if this is a problem with my setup and if so how to
resolve?

; find-relative-path: contract violation
;   expected: (and/c path-for-some-system? simple-form?)
;   given: #
;   context...:
;/racket/racket/collects/racket/path.rkt:114:0: do-explode-path
;/racket/racket/collects/racket/path.rkt:124:0: find-relative-path5
;/racket/racket/share/pkgs/tzinfo/tzinfo/private/os/unix.rkt:11:0: 
detect-tzid/unix
;/racket/racket/share/pkgs/tzinfo/tzinfo/private/zoneinfo.rkt:54:3: 
detect-system-tzid
;/racket/racket/share/pkgs/tzinfo/tzinfo/main.rkt:70:0: system-tzid
;
/racket/racket/collects/racket/contract/private/arrow-val-first.rkt:302:18
;/racket/racket/share/pkgs/gregor-lib/gregor/private/moment.rkt: 
[running body]
;/racket/racket/share/pkgs/gregor-lib/gregor/private/generics.rkt: 
[traversing imports]

-- 
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.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[racket-users] Re: Redex: call for alpha-equivalence beta testers

2015-09-24 Thread &#x27;William J. Bowman&#x27; via Racket Users
Paul asked me to forward this as racket-users is currently rejecting him:

> On Sep 24, 2015, at 14:36, Paul Stansifer  wrote:
> 
> Sorry about that; it looks like I forgot to check the examples after 
> disabling 'rib'. The fix is to change all instances of 'rib' to 'shadow'. 
> I'll try to push a fix soon, but I won't get a chance to do it today. 
> 
> Paul
> 
>> On Thursday, September 24, 2015, William J. Bowman  
>> wrote:
>> I get this error several times during the final `raco setup`:
>> 
>> redex-examples/redex/examples/lazy-with-binding.rkt:30:38: define-language: 
>> expected a shadow, nothing, or nonterminal
>>   in: (rib x ...)
>>   compilation context...:
>>
>> /home/bluephoenix47/workspace/racket/racket/share/extra-pkgs/redex/redex-examples/redex/examples/lazy-with-binding.rkt
>>   context...:
>>
>> /home/bluephoenix47/workspace/racket/racket/share/extra-pkgs/redex/redex-lib/redex/private/binding-forms-compiler.rkt:190:12:
>>  process-under
>>
>> /home/bluephoenix47/workspace/racket/racket/share/extra-pkgs/redex/redex-lib/redex/private/binding-forms-compiler.rkt:169:1:
>>  surface-bspec->pat&bspec
>>
>> /home/bluephoenix47/workspace/racket/racket/share/extra-pkgs/redex/redex-lib/redex/private/binding-forms-compiler.rkt:19:1:
>>  compile-binding-forms
>>
>> /home/bluephoenix47/workspace/racket/racket/share/extra-pkgs/redex/redex-lib/redex/private/reduction-semantics.rkt:1885:0
>>
>> /home/bluephoenix47/workspace/racket/racket/collects/syntax/wrap-modbeg.rkt:46:4
>>
>> /home/bluephoenix47/workspace/racket/racket/collects/compiler/cm.rkt:346:0: 
>> compile-zo*
>>
>> /home/bluephoenix47/workspace/racket/racket/collects/compiler/cm.rkt:561:26
>>
>> /home/bluephoenix47/workspace/racket/racket/collects/compiler/cm.rkt:553:42
>>
>> /home/bluephoenix47/workspace/racket/racket/collects/compiler/cm.rkt:518:0: 
>> maybe-compile-zo
>>
>> /home/bluephoenix47/workspace/racket/racket/collects/compiler/cm.rkt:633:2: 
>> do-check
>>/home/bluephoenix47/workspace/racket/racket/collects/compiler/cm.rkt:713:4
>>/home/bluephoenix47/workspace/racket/racket/collects/setup/..:261:28
>>/home/bluephoenix47/workspace/racket/racket/collects/setup/..:261:28
>>
>> /home/bluephoenix47/workspace/racket/racket/collects/setup/parallel-do.rkt:435:20:
>>  loop
>> 
>> 
>> I'd add an issue in the repo, but Paul's fork seems to have issues
>> disabled.
>> 
>> --
>> William J Bowman
>> 
>> On Sat, Sep 19, 2015 at 12:21:17PM -0500, Robby Findler wrote:
>> > Paul Stansifer has been implementing the ideas from his dissertation
>> > work in Redex and is now ready to share them with the world.
>> >
>> > Thanks to Paul, Redex languages now understand binding structure,
>> > meaning that if you write a substitution function that just blindly
>> > substitutes, it will actually properly do alpha conversion to avoid
>> > name collisions. In general, pattern matching now has alpha
>> > equivalence smarts (see the docs for more).
>> >
>> > The new features include the #:binding keyword in define-language and
>> > extend-language, and the alpha-equivalent? and substitute functions.
>> >
>> > The plan is to let it stay only in Paul's repo until the next release
>> > goes out and then push it to the main Redex repo to be included in the
>> > release after this one. If you'd like to give it a try, some
>> > instructions are below. Please let us know how it goes!
>> >
>> > Robby
>> >
>> >
>> > 
>> >
>> > To try it out, first download a snapshot build:
>> >
>> >http://pre.racket-lang.org/installers/
>> >
>> > and then create a parent directory to hold the git repo for Redex:
>> >
>> >   cd PLTDIR; mkdir extra-pkgs; cd extra-pkgs
>> >
>> > run this command to get the git version of Redex:
>> >
>> > raco pkg update --clone redex \
>> >   "git://github.com/racket/redex?path=redex" \
>> >   "git://github.com/racket/redex?path=redex-benchmark" \
>> >   "git://github.com/racket/redex?path=redex-doc" \
>> >   "git://github.com/racket/redex?path=redex-examples" \
>> >   "git://github.com/racket/redex?path=redex-gui-lib" \
>> >   "git://github.com/racket/redex?path=redex-lib" \
>> >   "git://github.com/racket/redex?path=redex-pict-lib" \
>> >   "git://github.com/racket/redex?path=redex-test"
>> >
>> > and then get Paul's version:
>> >
>> >   cd redex
>> >   git remote add paul https://github.com/paulstansifer/redex-1.git
>> >   git checkout public
>> >   raco setup
>> >
>> > --
>> > 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.
>> > For more options, visit https://groups.google.com/d/optout.

-- 
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 rac