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

-- 
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/CAFKxZVVcrJyoV3HsFzsgEtOOHoYna17EQf-nKYECiBpiDPZqfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 syntax->datum)
>
> (define (apply-lift op args)
>   (datum->syntax #f (apply op (->value args
>
> (syntax-parse (vector 1 2 3 4)
>   [#(a {~and {~seq {~between b 2 2} ...}
>  {~bind [x (apply-lift + #'(b ...))]}} c)
>(->value #'(a (b ...) c x))])
> ;; => '(1 (2 3) 4 5)
>
> (struct person (name age) #:prefab)
> (struct horse (color owner) #:prefab)
>
> (syntax-parse (vector 'brown 'bob 23)
>   [#(the-color {~and {~seq args ...}
>  {~bind [the-owner (apply-lift person #'(args ...))]}})
>(->value (apply-lift horse #'(the-color the-owner)))])
> ;; => '#s(horse brown #s(person bob 23))
>
>
>
>
>
> On Thu, Jun 27, 2019 at 3:31 PM David Storrs 
> wrote:
>
>>
>>
>> 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 5))  ;  NB:  does not work
>>>
>>> We have a few problems here.
>>>
>>> The pattern (vector a ? c) does not match the shape of the val-expr
>>> (vector 1 2 3 4).
>>>
>>> In the second sub-pattern (app + b ..2 x), Racket complains `..2' is an
>>> "incorrect use of ... in pattern" because every sub-pattern of `app' must
>>> independently match the result of (+ 2).
>>>
>>> To get the expected result '(1 (2 3) 4 5) from the actual result (list
>>> a b
>>> c x), we'd need the following bindings:
>>>
>>> a --> 1
>>> b --> '(2 3)
>>> c --> 4
>>> x --> 5
>>>
>>> At this point, I'm not sure what you're trying to do. Maybe you're trying
>>> to bind `b' to '(2 3), then `x' with the sum (+ 2 3), then `c' with 4.
>>>
>>> Here's one way to do it from within a single pattern:
>>>
>>> (match (vector 1 2 3 4)
>>>   [(and (vector a _ _ c)
>>> (app (λ (vec)
>>>(match vec
>>>  [(vector _ p q _)
>>>   (list (list p q) (+ p q))]))
>>>  (list b x)))
>>>(list a b c x)])
>>>
>>> > Less trivially, I'd like to be able to do something like this:
>>> >
>>> > #lang racket
>>> > (struct person (name age) #:prefab)
>>> > (struct horse (color owner) #:prefab)
>>> >
>>> > ; The following does not work
>>> > (match (vector 'brown 'bob 23)
>>> >   [(vector the-color (app (curry apply person) args ... the-owner))
>>> >(horse the-color the-owner)])
>>>
>>> Here's an adaptation of the above technique that works:
>>>
>>> (match (vector 'brown 'bob 23)
>>>   [(and (vector the-color _ _)
>>> (app (λ (vec)
>>>(match vec
>>>  [(vector _ name age)
>>>   (person name age)]))
>>>  the-owner))
>>>(horse the-color the-owner)])
>>>
>>
>> Makes sense -- it's two matches,  but still within one sexp.  Thanks.
>>
>>
>>> Incidentally, Algebraic Racket is designed for this:
>>>
>>> #lang algebraic/racket/base
>>>
>>> (require (prefix-in algebraic- algebraic/racket/base/forms))
>>>
>>> (algebraic-case (vector 1 2 3 4)
>>>   [#(a p q c)
>>>#:with b (list p q)
>>>#:with x (+ p q)
>>>(list a b c x)])
>>>
>>> (algebraic-case (vector 'brown 'bob 23)
>>>   [#(the-color name age)
>>>#:with the-owner (person name age)
>>>(horse the-color the-owner)])
>>>
>>> If a #:with directive fails, the overall match fails:
>>>
>>> (algebraic-case (vector 'brown 'bob 23)
>>>   [#(the-color name age)
>>>#:with the-owner #f
>>>#:with (person _ _) the-owner
>>>(horse the-color the-owner)])
>>>
>>>
>> That is drop-dead sexy.  Thanks, Eric.
>>
>>
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/CAE8gKocxGYu0vKvUzW%3Dfc1X7acXmZjCmz6mPKErDWvNmjKLmZw%40mail.gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKocj-t%2B8WUVyZq0d6OsjtUk5XxL170RDf_xvJp%2BYhO2i8w%40mail.gmail.com.
For more options, visit 

[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 structured as a
  monoid under cc-superimpose.

== A dynamic, interactive data visualization library ==

  An aggressive Algebraic Racket adaptation of the parts of D3.js I like.

  Initial use cases:
  - concurrent / distributed process network visualizations
  - hybrid text/graphical UIs with automatic layout
  - a generic feed browser

== A digital audio workstation library ==

  An experiment in real-time interactive Neuron programming.

  The base package will include a basic synth, a sampler, a sequencer, and
  a multi-track recorder -- like a developer API for Fruity Loops.

  Endpoints for MIDI and audio I/O should be easy to build with packages
  in the official repo.

  Optimistic feature list:
  - multi-track recording and playback (audio & MIDI)
  - non-destructive edits
  - mix automation
  - inter-process signal routing
  - global clock synchronization

I will then combine these projects into a hybrid DAW / VJ instrument and
target a live A/V performance for FARM 2020, the SIGPLAN workshop for
functional art and music co-located with ICFP.

If any part of this interests you, however large or small, reach out!

If you are working on related software, or planning to, speak up!

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAORuSUxhq5baH%3D7eKQ-hy6AMo1qnkRP60awNxYY_2VH_8kg8QQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 {~seq {~between b 2 2} ...}
 {~bind [x (apply-lift + #'(b ...))]}} c)
   (->value #'(a (b ...) c x))])
;; => '(1 (2 3) 4 5)

(struct person (name age) #:prefab)
(struct horse (color owner) #:prefab)

(syntax-parse (vector 'brown 'bob 23)
  [#(the-color {~and {~seq args ...}
 {~bind [the-owner (apply-lift person #'(args ...))]}})
   (->value (apply-lift horse #'(the-color the-owner)))])
;; => '#s(horse brown #s(person bob 23))





On Thu, Jun 27, 2019 at 3:31 PM David Storrs  wrote:

>
>
> 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 5))  ;  NB:  does not work
>>
>> We have a few problems here.
>>
>> The pattern (vector a ? c) does not match the shape of the val-expr
>> (vector 1 2 3 4).
>>
>> In the second sub-pattern (app + b ..2 x), Racket complains `..2' is an
>> "incorrect use of ... in pattern" because every sub-pattern of `app' must
>> independently match the result of (+ 2).
>>
>> To get the expected result '(1 (2 3) 4 5) from the actual result (list a
>> b
>> c x), we'd need the following bindings:
>>
>> a --> 1
>> b --> '(2 3)
>> c --> 4
>> x --> 5
>>
>> At this point, I'm not sure what you're trying to do. Maybe you're trying
>> to bind `b' to '(2 3), then `x' with the sum (+ 2 3), then `c' with 4.
>>
>> Here's one way to do it from within a single pattern:
>>
>> (match (vector 1 2 3 4)
>>   [(and (vector a _ _ c)
>> (app (λ (vec)
>>(match vec
>>  [(vector _ p q _)
>>   (list (list p q) (+ p q))]))
>>  (list b x)))
>>(list a b c x)])
>>
>> > Less trivially, I'd like to be able to do something like this:
>> >
>> > #lang racket
>> > (struct person (name age) #:prefab)
>> > (struct horse (color owner) #:prefab)
>> >
>> > ; The following does not work
>> > (match (vector 'brown 'bob 23)
>> >   [(vector the-color (app (curry apply person) args ... the-owner))
>> >(horse the-color the-owner)])
>>
>> Here's an adaptation of the above technique that works:
>>
>> (match (vector 'brown 'bob 23)
>>   [(and (vector the-color _ _)
>> (app (λ (vec)
>>(match vec
>>  [(vector _ name age)
>>   (person name age)]))
>>  the-owner))
>>(horse the-color the-owner)])
>>
>
> Makes sense -- it's two matches,  but still within one sexp.  Thanks.
>
>
>> Incidentally, Algebraic Racket is designed for this:
>>
>> #lang algebraic/racket/base
>>
>> (require (prefix-in algebraic- algebraic/racket/base/forms))
>>
>> (algebraic-case (vector 1 2 3 4)
>>   [#(a p q c)
>>#:with b (list p q)
>>#:with x (+ p q)
>>(list a b c x)])
>>
>> (algebraic-case (vector 'brown 'bob 23)
>>   [#(the-color name age)
>>#:with the-owner (person name age)
>>(horse the-color the-owner)])
>>
>> If a #:with directive fails, the overall match fails:
>>
>> (algebraic-case (vector 'brown 'bob 23)
>>   [#(the-color name age)
>>#:with the-owner #f
>>#:with (person _ _) the-owner
>>(horse the-color the-owner)])
>>
>>
> That is drop-dead sexy.  Thanks, Eric.
>
>
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAE8gKocxGYu0vKvUzW%3Dfc1X7acXmZjCmz6mPKErDWvNmjKLmZw%40mail.gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegtXfWvz9n42Sa5KdWLGy5-ZDDQP7NM6gcT0ShGwKVcK5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 5))  ;  NB:  does not work
>
> We have a few problems here.
>
> The pattern (vector a ? c) does not match the shape of the val-expr
> (vector 1 2 3 4).
>
> In the second sub-pattern (app + b ..2 x), Racket complains `..2' is an
> "incorrect use of ... in pattern" because every sub-pattern of `app' must
> independently match the result of (+ 2).
>
> To get the expected result '(1 (2 3) 4 5) from the actual result (list a b
> c x), we'd need the following bindings:
>
> a --> 1
> b --> '(2 3)
> c --> 4
> x --> 5
>
> At this point, I'm not sure what you're trying to do. Maybe you're trying
> to bind `b' to '(2 3), then `x' with the sum (+ 2 3), then `c' with 4.
>
> Here's one way to do it from within a single pattern:
>
> (match (vector 1 2 3 4)
>   [(and (vector a _ _ c)
> (app (λ (vec)
>(match vec
>  [(vector _ p q _)
>   (list (list p q) (+ p q))]))
>  (list b x)))
>(list a b c x)])
>
> > Less trivially, I'd like to be able to do something like this:
> >
> > #lang racket
> > (struct person (name age) #:prefab)
> > (struct horse (color owner) #:prefab)
> >
> > ; The following does not work
> > (match (vector 'brown 'bob 23)
> >   [(vector the-color (app (curry apply person) args ... the-owner))
> >(horse the-color the-owner)])
>
> Here's an adaptation of the above technique that works:
>
> (match (vector 'brown 'bob 23)
>   [(and (vector the-color _ _)
> (app (λ (vec)
>(match vec
>  [(vector _ name age)
>   (person name age)]))
>  the-owner))
>(horse the-color the-owner)])
>

Makes sense -- it's two matches,  but still within one sexp.  Thanks.


> Incidentally, Algebraic Racket is designed for this:
>
> #lang algebraic/racket/base
>
> (require (prefix-in algebraic- algebraic/racket/base/forms))
>
> (algebraic-case (vector 1 2 3 4)
>   [#(a p q c)
>#:with b (list p q)
>#:with x (+ p q)
>(list a b c x)])
>
> (algebraic-case (vector 'brown 'bob 23)
>   [#(the-color name age)
>#:with the-owner (person name age)
>(horse the-color the-owner)])
>
> If a #:with directive fails, the overall match fails:
>
> (algebraic-case (vector 'brown 'bob 23)
>   [#(the-color name age)
>#:with the-owner #f
>#:with (person _ _) the-owner
>(horse the-color the-owner)])
>
>
That is drop-dead sexy.  Thanks, Eric.


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKocxGYu0vKvUzW%3Dfc1X7acXmZjCmz6mPKErDWvNmjKLmZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 (vector a ? c) does not match the shape of the val-expr
(vector 1 2 3 4).

In the second sub-pattern (app + b ..2 x), Racket complains `..2' is an
"incorrect use of ... in pattern" because every sub-pattern of `app' must
independently match the result of (+ 2).

To get the expected result '(1 (2 3) 4 5) from the actual result (list a b
c x), we'd need the following bindings:

a --> 1
b --> '(2 3)
c --> 4
x --> 5

At this point, I'm not sure what you're trying to do. Maybe you're trying
to bind `b' to '(2 3), then `x' with the sum (+ 2 3), then `c' with 4.

Here's one way to do it from within a single pattern:

(match (vector 1 2 3 4)
  [(and (vector a _ _ c)
(app (λ (vec)
   (match vec
 [(vector _ p q _)
  (list (list p q) (+ p q))]))
 (list b x)))
   (list a b c x)])

> Less trivially, I'd like to be able to do something like this:
>
> #lang racket
> (struct person (name age) #:prefab)
> (struct horse (color owner) #:prefab)
>
> ; The following does not work
> (match (vector 'brown 'bob 23)
>   [(vector the-color (app (curry apply person) args ... the-owner))
>(horse the-color the-owner)])

Here's an adaptation of the above technique that works:

(match (vector 'brown 'bob 23)
  [(and (vector the-color _ _)
(app (λ (vec)
   (match vec
 [(vector _ name age)
  (person name age)]))
 the-owner))
   (horse the-color the-owner)])

Incidentally, Algebraic Racket is designed for this:

#lang algebraic/racket/base

(require (prefix-in algebraic- algebraic/racket/base/forms))

(algebraic-case (vector 1 2 3 4)
  [#(a p q c)
   #:with b (list p q)
   #:with x (+ p q)
   (list a b c x)])

(algebraic-case (vector 'brown 'bob 23)
  [#(the-color name age)
   #:with the-owner (person name age)
   (horse the-color the-owner)])

If a #:with directive fails, the overall match fails:

(algebraic-case (vector 'brown 'bob 23)
  [#(the-color name age)
   #:with the-owner #f
   #:with (person _ _) the-owner
   (horse the-color the-owner)])

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAORuSUxETFymuLMd1RQmUNdqrLug4CghXYvCDB__VYvGgP0zGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 there a way to do this?


Less trivially, I'd like to be able to do something like this:

#lang racket
(struct person (name age) #:prefab)
(struct horse (color owner) #:prefab)

; The following does not work
(match (vector 'brown 'bob 23)
  [(vector the-color (app (curry apply person) args ... the-owner))
   (horse the-color the-owner)])

I've been through the pattern matching docs in some detail and tried
various things, but my brain-fu is weak.

-- 
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/CAE8gKoeJL-YzSQ_SZ9te9OQ0HgmKiXW19624E8H6fScfFB2zpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 `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 `uncaught-exception-handler` value is inherited by new threads, so 
it shouldn't refer to a specific escape continuation. That continuation 
(maybe the whole parent thread) may be gone by the time a child thread 
raises an exception.

Ryan


On 6/27/19 12:42 PM, Jos Koot wrote:
>
>
> 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 works well as shown in module test-try-rkt.
> However, in a scribble interaction as shown in module try-scrbl,
> I get page try.html in which the interaction shows the error message
> and does not show the value returned by the test-proc.
>
> How can I make the interaction behave like in module test-try.rkt?
>
> In module try.rkt the use of eval is necessary.
>
> It is a strongly reduced version of a testing system
>
> that accepts sexprs and checks the returned values, the standard output and
>
> the error-message when an error is expected.
>
> Best wishes, Jos

-- 
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/5d14b620.1c69fb81.1ae35.7a64%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


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 `uncaught-exception-handler` value is inherited by new threads, so 
it shouldn't refer to a specific escape continuation. That continuation 
(maybe the whole parent thread) may be gone by the time a child thread 
raises an exception.


Ryan


On 6/27/19 12:42 PM, Jos Koot wrote:



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 works well as shown in module test-try-rkt.

However, in a scribble interaction as shown in module try-scrbl,

I get page try.html in which the interaction shows the error message

and does not show the value returned by the test-proc.



How can I make the interaction behave like in module test-try.rkt?



In module try.rkt the use of eval is necessary.

It is a strongly reduced version of a testing system

that accepts sexprs and checks the returned values, the standard output and

the error-message when an error is expected.



Best wishes, Jos

--
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/5d149d7c.1c69fb81.9bc88.bf49%40mx.google.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3f14ff66-cb05-ded3-7ef1-89e3eacf3b6e%40ccs.neu.edu.
For more options, visit https://groups.google.com/d/optout.


[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 works well as shown in module test-try-rkt.
However, in a scribble interaction as shown in module try-scrbl,
I get page try.html in which the interaction shows the error message
and does not show the value returned by the test-proc.

How can I make the interaction behave like in module test-try.rkt?

In module try.rkt the use of eval is necessary.
It is a strongly reduced version of a testing system
that accepts sexprs and checks the returned values, the standard output and
the error-message when an error is expected.

Best wishes, Jos

-- 
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/5d149d7c.1c69fb81.9bc88.bf49%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


test-try.rkt
Description: Binary data
Title: Try-test

•Try-testTry-testtest-procTry-testJacob J. A. Koot (require "try.rkt")procedure(test-proc) → void?blah blah
> (require "try.rkt")> (test-proc)monkey 

try.rkt
Description: Binary data


try.scrbl
Description: Binary data


[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 
> 
>  
> form creates a new object with by-name initialization arguments
>


Is the way of arguments specification the only difference between new and 
make-object? 

-- 
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/ffd27868-3921-40d7-95e6-41cb535ff540%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.