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

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

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

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

Thanks,

KC

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


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

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

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

Example:

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

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

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

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

Produces:

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

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

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


TODO:  Better formatting of the arguments.






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

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


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

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

Thank you.

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

> > shouldn't the entire parenthesized expression be given to the macro
> processor and then replaced with something valid before being rejected?
>
> That would be true if you're defining a macro, i.e. if you use
> `define-syntax` instead of `define`.
>
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAE8gKofDYFY8AYb2Lyh7CQXx1i01w8jm4DVcMrJL%3DQYHX9SsRQ%40mail.gmail.com
> .
>

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


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

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

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

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

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


[racket-users] PLDI 2022 First Call for Papers

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

*Call for Papers*

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

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

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

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

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

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

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

*Organizing Committee*

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

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

-- 
William J. Bowman

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


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

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

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

When run it yields 'ok.

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

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

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


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

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


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

2021-09-08 Thread David Storrs
raise-arguments-errors produces neatly stacked key/value pairs with
whitespace arranged such that values line up even when keys are of
different lengths.  Is there an easy way to get that for something that is
not an error?  I've been through both The Printer and the
raise-arguments-error sections in the Reference and can't find anything.

For example:

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

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

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