[racket-users] What are good references for implementing interpreters in Racket (or Scheme/LISP)?

2018-02-23 Thread Raoul Schorer
Hi, I am trying to write an interpreter for J in Racket as a hobby project. Would you guys know of good references on writing interpreters? Some nice things I found: - craftinginterpreters.com - beautifulracket.com - Racket J

[racket-users] Are canvases stackable?

2018-02-23 Thread Alex Harsanyi
You want to use a pasteboard% for the chess table and snip% objects for the pieces. You can draw the board as the pasteboard background in the on-draw method. You will have to implement snip management in the pasteboard though because by default snips can just be dragged around and placed

Re: [racket-users] What are good references for implementing interpreters in Racket (or Scheme/LISP)?

2018-02-23 Thread Matthias Felleisen
You need to distinguish different types of implementations: 1. An interpreter is a function that consumes a representation of your (J) program and determines its value (and output, if any). 2. A compiler is a function that consumes a representation of your (J) program and produces a

[racket-users] Are canvases stackable?

2018-02-23 Thread David Alkire
Is it possible to stack two (or more) canvases on top of one another. I'm working on a chess app and I don't want to draw individual squares under each piece. I would prefer to have a board canvas that doesn't change and a transparent canvas with pieces overlaying it. Is that possible? Is that

Re: [racket-users] racket (7) on a new arch

2018-02-23 Thread David Storrs
On Thu, Feb 22, 2018 at 11:14 AM, Alexander McLin wrote: > As one of those who have been following RISC-V progress for several years > and also interested in seeing Racket being ported to that architecture I > want to drop a note to let you know you have my support! > As

Re: [racket-users] racket (7) on a new arch

2018-02-23 Thread Alexander McLin
On Friday, February 23, 2018 at 11:08:23 AM UTC-5, David K. Storrs wrote: > > > On Thu, Feb 22, 2018 at 11:14 AM, Alexander McLin > wrote: > >> As one of those who have been following RISC-V progress for several years >> and also interested in seeing Racket being ported to

Re: [racket-users] Building full racket 6.10 and up fails on Nix/MacOS

2018-02-23 Thread Claes Wallin
On Friday, February 23, 2018 at 8:50:22 PM UTC+8, Claes Wallin wrote: > > On Friday, February 23, 2018 at 8:37:17 PM UTC+8, Matthew Flatt wrote: >> >> >> (define convert (bytes-open-converter "UTF-8" "UTF-16")) >> (bytes-convert convert (bytes 65 66 67 68)) >> >> which will fail if the iconv

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread Matthew Butterick
> On Feb 23, 2018, at 5:11 AM, 'Paulo Matos' via Racket Users > wrote: > > This fails because the i in the body of the test case does not exist at > run-time. I understand why this is failing. However if I try to replace > the i by #,(syntax->datum #'i) it also

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread Philip McGrath
Here is a version that works, with explanation following: #lang racket (require rackunit rackunit/text-ui (for-syntax syntax/parse)) (define-syntax gen-testsuite (syntax-parser [(_ n:exact-nonnegative-integer) #`(test-suite "Automated suite"

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread 'Paulo Matos' via Racket Users
On 23/02/18 14:56, Matthew Butterick wrote: > >> On Feb 23, 2018, at 5:11 AM, 'Paulo Matos' via Racket Users >> wrote: >> >> This fails because the i in the body of the test case does not exist at >> run-time. I understand why this is failing. However if I try

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread 'Paulo Matos' via Racket Users
On 23/02/18 15:07, Philip McGrath wrote: > > I also used syntax-parse to conveniently check that n really is a > nonnegative integer literal, though of course you could write such a > check with syntax-case if you really wanted to. > Thanks for the code snippet which goes in the same

Re: [racket-users] Building full racket 6.10 and up fails on Nix/MacOS

2018-02-23 Thread Matthew Flatt
At Thu, 22 Feb 2018 19:55:17 -0800 (PST), Claes Wallin wrote: > I have got racket-minimal 6.12 into Nix, and it builds properly on > aarch64-linux and on x86_64-darwin (MacOS). AArch64 probably hasn't had a > racket before (I haven't checked), and Nix/MacOS has been without a working > racket

Re: [racket-users] Building full racket 6.10 and up fails on Nix/MacOS

2018-02-23 Thread Claes Wallin
On Friday, February 23, 2018 at 8:37:17 PM UTC+8, Matthew Flatt wrote: > > At Thu, 22 Feb 2018 19:55:17 -0800 (PST), Claes Wallin wrote: > raco setup: --- summary of errors --- > > raco setup: error: during building docs for > > /racket-doc/scribblings/reference/reference.scrbl > > raco

[racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread 'Paulo Matos' via Racket Users
Hi, I am trying to get a macro working to generate an automatic testsuite. I have shrank my example to: #lang racket (define-syntax (gen-testsuite stx) (syntax-case stx () [(_ n) #`(test-suite "Automated suite" #,@(for/list ([i (syntax->datum #'n)])

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread Philip McGrath
The "Introduction" from the syntax/parse docs ( http://docs.racket-lang.org/syntax/stxparse-intro.html), is very good in the spirit of the Racket Guide and also explains why you want to use syntax/parse. Between that and the "Examples" section, I found I could handle many of the cases I wanted to

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread 'Paulo Matos' via Racket Users
On 23/02/18 15:20, Philip McGrath wrote: > The "Introduction" from the syntax/parse docs > (http://docs.racket-lang.org/syntax/stxparse-intro.html), is very good > in the spirit of the Racket Guide and also explains why you want to use > syntax/parse. Between that and the "Examples" section, I

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread 'Paulo Matos' via Racket Users
On 23/02/18 15:13, 'Paulo Matos' via Racket Users wrote: > That's true, thanks for pointing it out. I only just noticed you could > generate test-suites and test-cases at runtime with make-testcase and > make-testsuite. Therefore I will actually be doing this without a macro. > However, it's

Re: [racket-users] Generating automatic testsuites using a macro

2018-02-23 Thread Ryan Culpepper
On 2/23/18 3:36 PM, 'Paulo Matos' via Racket Users wrote: On 23/02/18 15:13, 'Paulo Matos' via Racket Users wrote: That's true, thanks for pointing it out. I only just noticed you could generate test-suites and test-cases at runtime with make-testcase and make-testsuite. Therefore I will

Re: [racket-users] Building full racket 6.10 and up fails on Nix/MacOS

2018-02-23 Thread Claes Wallin
On Friday, February 23, 2018 at 9:52:40 PM UTC+8, Claes Wallin wrote: > > On Friday, February 23, 2018 at 8:50:22 PM UTC+8, Claes Wallin wrote: >> >> On Friday, February 23, 2018 at 8:37:17 PM UTC+8, Matthew Flatt wrote: >>> >>> >>> (define convert (bytes-open-converter "UTF-8" "UTF-16")) >>>