Re: [racket-users] how to adapt BC code for Racket CS?

2020-04-17 Thread Siddhartha Kasivajhula
I've been regularly running "smoke" benchmarks for the relation
 library, and
just updated from Racket 7.5 (BC) to Racket CS 7.6. In case the data is
useful to anybody, here are the before/after times. These benchmarks
exercise elementary operations like comparisons for equality and order,
function composition, type transformations, algebraic composition of
numbers, strings, and so on. On these benchmarks, Racket CS seems to be
faster across the board:

Equivalence relations:
BC: 529ms
CS: 444ms

BC: 1661ms
CS: 1347ms

Order relations:
BC: 778ms
CS: 539ms

BC: 4621ms
CS: 3389ms

Functional operations:
BC: 442ms
CS: 435ms

BC: 2562ms
CS: 2159ms

Type transformations:
BC: 410ms
CS: 354ms

BC: 599ms
CS: 598ms

Algebraic operators:
BC: 600ms
CS: 494ms

BC: 8876ms
CS: 6740ms





On Tue, Feb 25, 2020 at 9:13 AM John Cowan  wrote:

> Perhaps separate OS processes would be a win in this case?
>
> On Tue, Feb 25, 2020 at 12:03 PM Matthew Butterick  wrote:
>
>>
>> > On Feb 25, 2020, at 7:05 AM, Matthew Flatt  wrote:
>> >
>> > * CS has a single heap with a single-threaded, stop-the-world GC ---
>> >   so allocation and GC easily become a bottleneck.
>> >
>> >   If GHC's experience is any guide, making the GC itself multithreaded
>> >   may address much of this problem.
>> >
>> > Locks on shared system data structures may also be a significant
>> > obstacle to CPU utilization with places in CS, but I'm not sure.
>>
>>
>>
>> FWIW some quick timings on a Pollen render of practicaltypography.com.
>> Though extra cores have diminishing net returns under Racket BC, the
>> returns are still positive. Under Racket CS, by contrast, net performance
>> degrades with more than 4 cores.
>>
>> Racket BC
>>
>> single core
>> real4m21.191s
>> user3m37.940s
>> sys 0m42.388s
>>
>> parallel @ 2 cores
>> real2m46.235s
>> user4m22.160s
>> sys 0m56.270s
>>
>> parallel @ 3 cores
>> real1m54.134s
>> user4m10.330s
>> sys 0m54.533s
>>
>> parallel @ 4 cores
>> real1m43.055s
>> user4m46.933s
>> sys 1m5.948s
>>
>> parallel @ 6 cores
>> real1m34.783s
>> user6m8.522s
>> sys 1m32.125s
>>
>> parallel @ 8 cores
>> real1m18.137s
>> user6m24.778s
>> sys 1m38.617s
>>
>> parallel @ 12 cores
>> real1m14.924s
>> user8m30.239s
>> sys 2m14.671s
>>
>> Racket CS
>>
>> single core
>> real5m1.422s
>> user4m16.300s
>> sys 0m44.253s
>>
>> parallel @ 2 cores
>> real3m25.016s
>> user4m45.385s
>> sys 0m54.634s
>>
>> parallel @ 3 cores
>> real2m52.780s
>> user4m57.951s
>> sys 1m3.184s
>>
>> parallel @ 4 cores
>> real2m42.471s
>> user5m22.796s
>> sys 1m17.889s
>>
>> parallel @ 6 cores
>> real2m44.513s
>> user6m26.700s
>> sys 1m54.549s
>>
>> parallel @ 8 cores
>> real2m56.782s
>> user8m4.029s
>> sys 2m58.554s
>>
>> parallel @ 12 cores
>> real3m2.116s
>> user9m34.846s
>> sys 5m5.443s
>>
>>
>>
>> --
>> 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/3D11BBCF-B0FE-473B-8997-09B7CB60D761%40mbtype.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/CAD2gp_S_kzyXFLCet_u8dHMCk_Wpgf-iS22Z7Az-oCNBXoEm5g%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/CACQBWF%3D0nTHabYLKD0hyGDPKBq%2B3N%3DkJPbXhm2f%2BjOWckdZtrA%40mail.gmail.com.


Re: [racket-users] How can I write a macro that recognizes arbitrary other macros?

2020-04-17 Thread Ryan Kramer
Thanks! That was much easier than I was expecting.

For posterity, here is some working code but be warned that I don't know 
whether 'module is the best expansion context to use. But this is a toy 
example anyway.

#lang racket

(define-syntax (collect stx)
  (syntax-case stx (define-values)
[(_ (define-values (id ...) expr) rest ...)
 #'(let-values ([(id ...) expr])
 (collect rest ...))]
[(_ (macro arg ...) rest ...)
 (syntax-local-value #'macro (lambda () #f))
 (let ([expanded (local-expand #'(macro arg ...)
   'module
   (list #'define-values))])
   (syntax-case expanded (define-values)
 [(define-values stuff ...)
  #`(collect #,expanded rest ...)]
 [else
  #'(cons (macro arg ...) (collect rest ...))]))]
[(_ a rest ...)
 #'(cons a (collect rest ...))]
[(_)
 #'(list)]))

(define-syntax-rule (my-define stuff ...)
  (define stuff ...))

(define-syntax-rule (my-list stuff ...)
  (list stuff ...))

(collect 1 2 (my-define x 3) x (my-list 4 5))


On Thursday, April 16, 2020 at 9:50:45 PM UTC-5, Matthew Flatt wrote:
>
> The main trick in this case is to recognize `define-values` (which is 
> what `define` expands to) instead of `define`. That's because 
> `define-values` propagates syntax arming to its identifiers and 
> right-hand side, which means that your macro is allowed to pull it 
> apart. 
>
> You'll also need to use an expansion context other than 'expression, 
> though. 
>

-- 
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/8b62651d-86de-4ab8-b9b7-27c4a818dfbf%40googlegroups.com.


[racket-users] Debugging "stuck-ghost-mouse-button" problems

2020-04-17 Thread K H
Hi all,

I'm trying to debug my (Windows7, 2-button trackpad) system, specifically,
weird behaviour with the mouse.

To help determine what the actual problem is, I wrote a small Racket GUI
progam, that surprised me with the following output:

object:object:my-frame% type:enter pos:(338,32) buttons:(#f #t #f) mods:(#f
#f #f) keys:()
object:object:list-box% type:enter pos:(337,32) buttons:(#f #f #f) mods:(#f
#f #f) keys:()

The code (given below) has a simple list-box% inside of a frame% and the
frame% overrides on-subwindow-event to receive mouse 'enter and 'leave
events, printing to stdout some information from the mouse event.

The output shows that the mouse was moved into the list-box%, triggering
the two 'enter events, (one for entering the frame%, one for entering the
list-box%) but notice that the mouse-buttons held down and
keyboard-modifiers pressed are different, despite them being part of the
same motion, with no actual mouse buttons pressed and both the shift and
control keys continuously pressed.

The larger problem I'm chasing is under some circumstances the non-existent
middle mouse button gets "stuck" down. This of course gives erratic
behaviour in various programs e.g. left-click on a tab in the tab-bar in
Chrome causes the tab to close rather than give it focus, no  window reacts
as the mouse cursor is moved over their minimize/maximize/close buttons,
nor are those buttons clickable.

A temporary solution I have found that appears to clear the "stuck button"
is to e.g.randomly click on some icons in the windows task bar, until the
minimize/maximize/close buttons of some window again react when the mouse
cursor is moved over them. A more permanent solution is a reboot, which
delays the onset until some as yet unknown trigger. Either way the
"stuck-ghost-mouse-button" situation eventually returns.

Is there a problem in my test code? Any ideas as to the cause of the
weirdness shown in the code output? Why does the second mouse event not
show the same button state and the  and  as pressed?

And any ideas as to the cause of the larger "stuck-ghost-mouse-button" or
how to further determine its cause (my current thinking is that it is
something to do with Chrome, but dunno really).

Thanks in advance,

Cheers,

Kieron.



#lang racket

(require racket/gui)

(define (queued-printf . msg)
  (let {[print-msg msg]}
(queue-callback
  (lambda ()
(apply printf print-msg)
)
  #t)))

(define (output-event-state t e o)
(queued-printf
   (format "object:~a type:~a pos:(~a,~a) buttons:(~a ~a ~a)
mods:(~a ~a ~a) keys:(~a)~n"
   o t
   (send e get-x) (send e get-y)
   (send e get-left-down)
   (send e get-middle-down)
   (send e get-right-down)
   (send e get-mod3-down)
   (send e get-mod4-down)
   (send e get-mod5-down)
   (string-append
 (if (send e get-shift-down) "" "")
 (if (send e get-control-down) "" "")
 (if (send e get-alt-down) "" "")
 (if (send e get-meta-down) "" "")
 (if (send e get-caps-down) "" "")
 

(define my-frame%
  (class frame%
(super-new)
(define/override (on-subwindow-event r e)
  (let ([event-type (send e get-event-type)]
[object-name (object-name r)])
(when (member event-type (list 'enter 'leave))
  (output-event-state event-type e object-name)))
  #f)
))

(define f (new my-frame%
   [label "test list-box"]
   [width 400]
   [height 200]))

(define l (new list-box%
   [parent f]
   [label "options"]
   [choices (list "apple" "pear" "cherry")]
   [stretchable-width #t]
   [stretchable-height #t]))

(send f show #t)

-- 
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/CAEEP09AGHXawE1bQYYmRhP%3D%2Bjp9LTufCP%3DqM-Pmr7hTW77PheA%40mail.gmail.com.


Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Marc Kaufmann
Fantastic, thanks for the clarification Ben. I'll start using it to see
what it does, as I have a few functions that occasionally throw errors
through contracts - which I should call 'blame' - yet I can't figure out
much from it.

On Fri, Apr 17, 2020 at 6:09 PM Ben Greenman 
wrote:

> On 4/17/20, Sorawee Porncharoenwase  wrote:
> >>
> >> My understanding is that contract-out only provides protection against
> >> inappropriate calls from clients *outside* the module, whereas
> >> define/contract enforces the contract against everyone, including things
> >> inside the module.  Do I have that right?
> >>
> >
> > I think that's correct. Note though that the implication is that
> > define/contract could produce a much more expensive code, especially for
> > recursive function, since it will need to check against the contract for
> > every iteration.
> >
> >
> >> On a related topic, I don't understand the concept of positive and
> >> negative blame.  Can someone fill me in?
> >>
> >
> > I always forget which is positive and negative, so I won't use the terms
> > here (and too lazy to lookup). But roughly, suppose you attach a function
> > contract (-> number? string?) to a function value, then there are mainly
> > two ways things could go wrong.
> >
> > 1. Client uses the function incorrectly by calling it with non-number.
> > 2. The function itself returns a non-string.
> >
> > A blame would indicate whose party is at fault when a contract is
> > violated--caller or the function itself.
>
> 1 = negative = the client that uses the value
> 2 = positive = the code that made the value
>
> But unless you're using `contract` directly, you don't need to know
> these words to benefit from contracts.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/VA_ufNV6J24/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAFUu9R5vabY64_HZRWv1zNoyuEd7K5p8i8jfVN0JB1reufYEPw%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/CAD7_NO7Yo%2BL-T5JnxKB74-OPNce3On0YY%3DujHLR7L%2B1Ch%2Bqz1w%40mail.gmail.com.


Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Ben Greenman
On 4/17/20, Sorawee Porncharoenwase  wrote:
>>
>> My understanding is that contract-out only provides protection against
>> inappropriate calls from clients *outside* the module, whereas
>> define/contract enforces the contract against everyone, including things
>> inside the module.  Do I have that right?
>>
>
> I think that's correct. Note though that the implication is that
> define/contract could produce a much more expensive code, especially for
> recursive function, since it will need to check against the contract for
> every iteration.
>
>
>> On a related topic, I don't understand the concept of positive and
>> negative blame.  Can someone fill me in?
>>
>
> I always forget which is positive and negative, so I won't use the terms
> here (and too lazy to lookup). But roughly, suppose you attach a function
> contract (-> number? string?) to a function value, then there are mainly
> two ways things could go wrong.
>
> 1. Client uses the function incorrectly by calling it with non-number.
> 2. The function itself returns a non-string.
>
> A blame would indicate whose party is at fault when a contract is
> violated--caller or the function itself.

1 = negative = the client that uses the value
2 = positive = the code that made the value

But unless you're using `contract` directly, you don't need to know
these words to benefit from contracts.

-- 
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/CAFUu9R5vabY64_HZRWv1zNoyuEd7K5p8i8jfVN0JB1reufYEPw%40mail.gmail.com.


Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Sorawee Porncharoenwase
>
> My understanding is that contract-out only provides protection against
> inappropriate calls from clients *outside* the module, whereas
> define/contract enforces the contract against everyone, including things
> inside the module.  Do I have that right?
>

I think that's correct. Note though that the implication is that
define/contract could produce a much more expensive code, especially for
recursive function, since it will need to check against the contract for
every iteration.


> On a related topic, I don't understand the concept of positive and
> negative blame.  Can someone fill me in?
>

I always forget which is positive and negative, so I won't use the terms
here (and too lazy to lookup). But roughly, suppose you attach a function
contract (-> number? string?) to a function value, then there are mainly
two ways things could go wrong.

1. Client uses the function incorrectly by calling it with non-number.
2. The function itself returns a non-string.

A blame would indicate whose party is at fault when a contract is
violated--caller or the function itself.


>
>
>> Here's an example to play with. Submod A provides two functions: f0 is
>> made with define/contract and f1 with contract-out.
>>
>> ```
>>   #lang racket
>>
>>   (module A racket
>> (define/contract (f0 x)
>>   (-> natural? natural?)
>>   x)
>>
>> (define (f1 x)
>>   x)
>>
>> (provide f0)
>> (provide (contract-out [f1 (-> natural? natural?)])))
>>
>>   (module B racket
>> (require (submod ".." A))
>> (f0 'hello)
>> #;(f1 'hello))
>>
>>   (require 'B)
>> ```
>>
>> If B makes a mistake with f0, the error blames submod A.
>> But if B makes a mistake with f1, the error blames B.
>>
>>
>> The contract library makes these blame errors internally. I don't
>> think there's any way to customize short of using `contract` directly.
>>
>> > Is it related to this part of the documentation of `contract-out`
>> > (
>> https://docs.racket-lang.org/reference/attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._contract-out%29%29
>> )
>> > - which I admittedly don't understand:
>> >
>> > "The implementation of contract-out
>> > <
>> https://docs.racket-lang.org/reference/attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._contract-out%29%29
>> >
>> > uses syntax-property
>> > <
>> https://docs.racket-lang.org/reference/stxprops.html#%28def._%28%28quote._~23~25kernel%29._syntax-property%29%29
>> >
>> > to attach properties to the code it generates that records the syntax of
>> > the contracts in the fully expanded program. Specifically, the symbol '
>> > provide/contract-original-contract is bound to vectors of two elements,
>> the
>> > exported identifier and a syntax object for the expression that produces
>> > the contract controlling the export."
>>
>> I was only thinking of the "blaming: " part of error messages.
>>
>> Both define/contract and contract-out can print the whole contract; I
>> don't think this syntax-property gives contract-out any advantage
>>
>> (Sadly, the whole contract is sometimes too big to help me find a
>> problem.)
>>
>> --
>> 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/CAFUu9R5BMG5ZFVrddrJ-6uceV%2B3936ZudE-8ESObycw9B%2BRjcg%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/CAE8gKof2M%2BHuCf%2B2hfTKbVxCxGEb1Vtx%2BaXehYNZXhttpgMNPA%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/CADcuegskOV0cOQ8xYjTmbED2XA8dvZj9OkY_aFP0_7d28Lho3g%40mail.gmail.com.


Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread David Storrs
On Fri, Apr 17, 2020 at 9:45 AM Ben Greenman 
wrote:

> Hi Marc,
>
>
> >> For contracts, though, (provide (contract-out ...)) gives better error
> >> messages than define/contract.
> >>
> >
> > In what sense is this the case, and where can I read more about the
> > differences, as well as how to improve errors of contracts?
>
> contract-out gives better error messages than define/contract in the
> sense that it has better blame
>
> A define/contract needs to immediately decide who could be blamed for
> future errors --- because the new definition can be used right away.
>
> A contract-out can wait until another module requires the definition
> --- and tailor its blame errors to different clients.
>

My understanding is that contract-out only provides protection against
inappropriate calls from clients *outside* the module, whereas
define/contract enforces the contract against everyone, including things
inside the module.  Do I have that right?  If so, I feel much more
comfortable using the latter even if its error messages are not quite as
good.

On a related topic, I don't understand the concept of positive and negative
blame.  Can someone fill me in?


> Here's an example to play with. Submod A provides two functions: f0 is
> made with define/contract and f1 with contract-out.
>
> ```
>   #lang racket
>
>   (module A racket
> (define/contract (f0 x)
>   (-> natural? natural?)
>   x)
>
> (define (f1 x)
>   x)
>
> (provide f0)
> (provide (contract-out [f1 (-> natural? natural?)])))
>
>   (module B racket
> (require (submod ".." A))
> (f0 'hello)
> #;(f1 'hello))
>
>   (require 'B)
> ```
>
> If B makes a mistake with f0, the error blames submod A.
> But if B makes a mistake with f1, the error blames B.
>
>
> The contract library makes these blame errors internally. I don't
> think there's any way to customize short of using `contract` directly.
>
> > Is it related to this part of the documentation of `contract-out`
> > (
> https://docs.racket-lang.org/reference/attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._contract-out%29%29
> )
> > - which I admittedly don't understand:
> >
> > "The implementation of contract-out
> > <
> https://docs.racket-lang.org/reference/attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._contract-out%29%29
> >
> > uses syntax-property
> > <
> https://docs.racket-lang.org/reference/stxprops.html#%28def._%28%28quote._~23~25kernel%29._syntax-property%29%29
> >
> > to attach properties to the code it generates that records the syntax of
> > the contracts in the fully expanded program. Specifically, the symbol '
> > provide/contract-original-contract is bound to vectors of two elements,
> the
> > exported identifier and a syntax object for the expression that produces
> > the contract controlling the export."
>
> I was only thinking of the "blaming: " part of error messages.
>
> Both define/contract and contract-out can print the whole contract; I
> don't think this syntax-property gives contract-out any advantage
>
> (Sadly, the whole contract is sometimes too big to help me find a problem.)
>
> --
> 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/CAFUu9R5BMG5ZFVrddrJ-6uceV%2B3936ZudE-8ESObycw9B%2BRjcg%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/CAE8gKof2M%2BHuCf%2B2hfTKbVxCxGEb1Vtx%2BaXehYNZXhttpgMNPA%40mail.gmail.com.


Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Ben Greenman
Hi Marc,


>> For contracts, though, (provide (contract-out ...)) gives better error
>> messages than define/contract.
>>
>
> In what sense is this the case, and where can I read more about the
> differences, as well as how to improve errors of contracts?

contract-out gives better error messages than define/contract in the
sense that it has better blame

A define/contract needs to immediately decide who could be blamed for
future errors --- because the new definition can be used right away.

A contract-out can wait until another module requires the definition
--- and tailor its blame errors to different clients.

Here's an example to play with. Submod A provides two functions: f0 is
made with define/contract and f1 with contract-out.

```
  #lang racket

  (module A racket
(define/contract (f0 x)
  (-> natural? natural?)
  x)

(define (f1 x)
  x)

(provide f0)
(provide (contract-out [f1 (-> natural? natural?)])))

  (module B racket
(require (submod ".." A))
(f0 'hello)
#;(f1 'hello))

  (require 'B)
```

If B makes a mistake with f0, the error blames submod A.
But if B makes a mistake with f1, the error blames B.


The contract library makes these blame errors internally. I don't
think there's any way to customize short of using `contract` directly.

> Is it related to this part of the documentation of `contract-out`
> (https://docs.racket-lang.org/reference/attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._contract-out%29%29)
> - which I admittedly don't understand:
>
> "The implementation of contract-out
> 
> uses syntax-property
> 
> to attach properties to the code it generates that records the syntax of
> the contracts in the fully expanded program. Specifically, the symbol '
> provide/contract-original-contract is bound to vectors of two elements, the
> exported identifier and a syntax object for the expression that produces
> the contract controlling the export."

I was only thinking of the "blaming: " part of error messages.

Both define/contract and contract-out can print the whole contract; I
don't think this syntax-property gives contract-out any advantage

(Sadly, the whole contract is sometimes too big to help me find a problem.)

-- 
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/CAFUu9R5BMG5ZFVrddrJ-6uceV%2B3936ZudE-8ESObycw9B%2BRjcg%40mail.gmail.com.


Re: [racket-users] NixOS: (help map) does not find documentation

2020-04-17 Thread unlimitedscolobb
On Thursday, April 16, 2020 at 7:48:35 PM UTC+2, asumu wrote:
>
> On 2020-04-16 05:19:26 -0700, unlimitedscolobb wrote: 
> >I started a discussion on NixOS Discourse here: 
> >
> https://discourse.nixos.org/t/racket-does-not-find-documentation-after-update/
>  
> >Would you mind submitting a PR from your `racket-enable-useprefix` 
> branch? 
> >If you don't have time, I can handle that as well, but it's probably 
> best 
> >that it comes from you. 
>
> No problem, and thanks for testing it! I submitted a PR here: 
>
>   https://github.com/NixOS/nixpkgs/pull/85385 
>
>
Cool, thank you!  I made some noise on the PR and on the corresponding 
thread on Discourse, let's hope your change gets merged soon.

-
Sergiu
 

Cheers, 
> Asumu 
>

-- 
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/d78e3bf1-749a-4d63-8484-62f46341e0ac%40googlegroups.com.


Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Marc Kaufmann
Hi Ben,

you wrote (snip):

For contracts, though, (provide (contract-out ...)) gives better error 
> messages than define/contract. 
>

In what sense is this the case, and where can I read more about the 
differences, as well as how to improve errors of contracts? Is it related 
to this part of the documentation of `contract-out` 
(https://docs.racket-lang.org/reference/attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._contract-out%29%29)
 
- which I admittedly don't understand:

"The implementation of contract-out 

 
uses syntax-property 

 
to attach properties to the code it generates that records the syntax of 
the contracts in the fully expanded program. Specifically, the symbol '
provide/contract-original-contract is bound to vectors of two elements, the 
exported identifier and a syntax object for the expression that produces 
the contract controlling the export."

Cheers,
Marc

-- 
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/a046c971-8207-4486-bfb3-723a5d7d0446%40googlegroups.com.