Re: [racket-users] [PSA] Upcoming projects

2019-06-27 Thread Daniel Prager
Hi Eric They all sound great. I'm particularly interested in the first two, and was very impressed by the Diagram project gallery , and it would be great to see in Racket. Quick question: Why *Algebraic* Racket? Dan --

Re: [racket-users] Pattern matching as computation

2019-06-27 Thread David Storrs
Oh, neat. Thank you, Sorawee. On Thu, Jun 27, 2019 at 7:26 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > If you want only one match, it seems what you really want is ~seq-like > form from syntax/parse. E.g., > > #lang racket > > (require syntax/parse) > > (define ->value

[racket-users] [PSA] Upcoming projects

2019-06-27 Thread Eric Griffis
Hello everyone, Over the next few months, I will be breaking ground on three new projects. == A diagramming library == An Algebraic Racket port of Haskell's diagrams library: https://archives.haskell.org/projects.haskell.org/diagrams/ I love this design. It's like Pict, but the API is

Re: [racket-users] Pattern matching as computation

2019-06-27 Thread Sorawee Porncharoenwase
If you want only one match, it seems what you really want is ~seq-like form from syntax/parse. E.g., #lang racket (require syntax/parse) (define ->value syntax->datum) (define (apply-lift op args) (datum->syntax #f (apply op (->value args (syntax-parse (vector 1 2 3 4) [#(a {~and

Re: [racket-users] Pattern matching as computation

2019-06-27 Thread David Storrs
On Thu, Jun 27, 2019 at 5:13 PM Eric Griffis wrote: > On Thu, Jun 27, 2019 at 11:56 AM David Storrs > wrote: > > > > Suppose instead I wanted to have a pattern like so (this does not work): > > > > (match (vector 1 2 3 4) > > [(vector a (app + b ..2 x) c) (list a b c x)] > > ; => '(1 (2 3) 4

Re: [racket-users] Pattern matching as computation

2019-06-27 Thread Eric Griffis
On Thu, Jun 27, 2019 at 11:56 AM David Storrs wrote: > > Suppose instead I wanted to have a pattern like so (this does not work): > > (match (vector 1 2 3 4) > [(vector a (app + b ..2 x) c) (list a b c x)] > ; => '(1 (2 3) 4 5)) ; NB: does not work We have a few problems here. The pattern

[racket-users] Pattern matching as computation

2019-06-27 Thread David Storrs
This works: (match (vector 1 2 3 4) [(vector a b (app add1 c) d) (list a b c d)]) ; => '(1 2 4 4) Suppose instead I wanted to have a pattern like so (this does not work): (match (vector 1 2 3 4) [(vector a (app + b ..2 x) c) (list a b c x)] ; => '(1 (2 3) 4 5)) ; NB: does not work Is

RE: [racket-users] problem with current-error-port in scribbleinteraction

2019-06-27 Thread Jos Koot
Perfect. (with-handlers ((exn:fail? exception-handler)) ...) works nice. Thanks very much for your rapid response, Jos From: Ryan Culpepper Sent: 27 June 2019 13:36 To: Jos Koot; Racket Users Subject: Re: [racket-users] problem with current-error-port in scribbleinteraction The

Re: [racket-users] problem with current-error-port in scribble interaction

2019-06-27 Thread Ryan Culpepper
The `uncaught-exception-handler` parameter controls the *bottom* of the exception handler stack, so it won't override the exception handler installed by Scribble's `interaction` form. If you use `with-handlers` (or `call-with-exception-handler`) instead, it should work. The

[racket-users] problem with current-error-port in scribble interaction

2019-06-27 Thread Jos Koot
Hi, The attachments are assumed to reside in the same directory and are reduced forms of more elaborated code. In module try-rkt I have code that captures errors such as to avoid an error-message being written on the current-error-port, to retrieve the error-message and to return normally. This

[racket-users] new or make-object?

2019-06-27 Thread Amir Teymuri
According to the docs: The make-object > > > procedure creates a new object with by-position initialization arguments, > the new >