Re: [racket-users] Adding interactive overlays to racket plots

2018-03-20 Thread Alex Harsanyi
About a month ago, the changes for the plot overlays were merged into the main plot repository and will be available in the next Racket release. Based on feedback from Ben Greenman, the implementation is different than my original prototype, but it is more flexible -- thanks to Ben for

Re: [racket-users] Prefab and mutable

2018-03-20 Thread 'Paulo Matos' via Racket Users
On 20/03/18 11:56, Philip McGrath wrote: > Mutable values generally cannot be sent as messages on place channels. > ("To a first approximation, place channels support only immutable, > transparent values as messages." > http://docs.racket-lang.org/reference/places.html The documentation for >

Re: [racket-users] Prefab and mutable

2018-03-20 Thread 'Paulo Matos' via Racket Users
On 20/03/18 12:50, Philip McGrath wrote: > The reference section on "Reading Structures" has more relevant details: > http://docs.racket-lang.org/reference/reader.html#%28part._parse-structure%29 > > -Philip > Thanks for your help on this. I will have a read. -- Paulo Matos -- You

[racket-users] Prefab and contracts

2018-03-20 Thread 'Paulo Matos' via Racket Users
Hello, In a similar comment to my previous thread, I am yet again surprised at this: a.rkt: #lang racket (provide (struct-out foo)) (struct foo (a b) #:prefab) b.rkt: #lang racket (require "a.rkt") (place-message-allowed? (foo 1 2)) This works! However, try to provide in a.rkt foo like

Re: [racket-users] Prefab and mutable

2018-03-20 Thread Philip McGrath
Given your definition of `(struct f (a b) #:prefab #:mutable)`, you will see that `(equal? (f 1 2) #s(f 1 2))` returns `#false`, because `#s(f 1 2)` does not evaluate to an instance of your `f` structure type. The printed form of a structure created with `(f 1 2)` is `'#s((f #(0 1)) 1 2)`. Per

Re: [racket-users] Prefab and mutable

2018-03-20 Thread Philip McGrath
The reference section on "Reading Structures" has more relevant details: http://docs.racket-lang.org/reference/reader.html#%28part._parse-structure%29 -Philip On Tue, Mar 20, 2018 at 6:48 AM, Philip McGrath wrote: > Given your definition of `(struct f (a b) #:prefab

[racket-users] Prefab and mutable

2018-03-20 Thread 'Paulo Matos' via Racket Users
Hi, I was quite surprised by a 'feature' of prefab mutable structures: #lang racket (struct f (a b) #:prefab #:mutable) (place-message-allowed? (f 1 2)) (place-message-allowed? #s(f 1 2)) I was expecting both to return true but to my amazement it was not the case. The one created with

Re: [racket-users] Prefab and mutable

2018-03-20 Thread Philip McGrath
Mutable values generally cannot be sent as messages on place channels. ("To a first approximation, place channels support only immutable, transparent values as messages." http://docs.racket-lang.org/reference/places.html The documentation for `place-message-allowed?` is also specific that only

Re: [racket-users] Prefab and contracts

2018-03-20 Thread Daniel Feltey
The same behavior occurs with vectors, the program (define v (vector 1 2)) (define/contract vc (vectorof integer?) (vector 1 2)) (place-message-allowed? v) (place-message-allowed? vc) Produces: #t #f I think the issue here is that both contracted vectors and structs are wrapped in

[racket-users] error during prompt calculation: path->string: contract violation

2018-03-20 Thread Kieron Hardy
Hello all, On Windows, I noticed that Racket's initialization file is incorrectly set to %HOMEDIRVE%\%HOMEPATH%\.racketrc.rktl $ grep 'WINDOWS_INIT_FILENAME' -r . ./racket-master/racket/src/gracket/grmain.c:#define WINDOWS_INIT_FILENAME "%%HOMEDIRVE%%\\%%HOMEPATH%%\\gracketrc.rktl"

Re: [racket-users] struct-copy question

2018-03-20 Thread Kevin Forchione
Just read your GitHub link and see the problem goes beyond my simple #:auto issue. Thanks for that link. I’m pretty green to all the thorny issues when it comes to dressing primitive datatypes up in fancy bindings and hope the magicians of indirection can somehow pull a rabbit out of the hat

Re: [racket-users] Using match to decompose a nested hash

2018-03-20 Thread Alex Knauth
> On Mar 20, 2018, at 11:51 PM, Alex Knauth wrote: > > > >> On Mar 19, 2018, at 11:37 AM, David Storrs wrote: >> >> This does not work: > >> (define user (hash 'name "bob" 'job (hash 'type 'dev 'id 112))) >> (match user >> [(hash-table

Re: [racket-users] Using match to decompose a nested hash

2018-03-20 Thread Alex Knauth
> On Mar 19, 2018, at 11:37 AM, David Storrs wrote: > > This does not work: > (define user (hash 'name "bob" 'job (hash 'type 'dev 'id 112))) > (match user > [(hash-table ('name name) ('job (hash-table 'type type 'id id))) >(displayln name) >(displayln type)

Re: [racket-users] struct-copy question

2018-03-20 Thread Kevin Forchione
On Mar 20, 2018, at 9:21 AM, Kevin Forchione wrote: > > Sorry, wrong example! >(struct fish (color (weight #:auto)) #:transparent) >(define marlin (fish 'orange-and-white)) >(define dory (struct-copy fish marlin [color 'blue]))

Re: [racket-users] struct-copy question

2018-03-20 Thread Kevin Forchione
On Mar 19, 2018, at 2:35 PM, Alexis King wrote: > > I’m late to this thread, but perhaps I can clarify some things that I > don’t think have been made entirely clear. > > First of all, you are absolutely correct that structures, at runtime, > know nothing whatsoever