Re: [racket-users] Re: Nesting structs – I'm confused!

2016-02-23 Thread Alexis King
> I'm not sure whether I should have known that the #:auto value would be the > same object, so to speak, across all instances. Is there a bigger picture, in > that respect, or is it just that structs happen to work that way, and other > data structures might not? A part of me just wants to

[racket-users] Re: Nesting structs – I'm confused!

2016-02-23 Thread Gavin McGimpsey
Thanks, Ben! Switching to a custom instantiation worked. I couldn't figure out the #n notation, but you must be right about it being cyclic – I saw #1= / #1# in another example I tried that was even more deeply nested. Trouble was, that's not something you can Google for! I'm not sure whether

Re: [racket-users] Nesting structs – I'm confused!

2016-02-23 Thread Benjamin Greenman
Very puzzling! I think you're doing the update correctly: > (hash-ref (hashtainer-contents (hash-ref (hashtainer-contents the-hashtainer) 'layer-1)) 'layer-2) "hello from layer 2" But here's the trouble: > (eq? (hashtainer-contents the-hashtainer) (hashtainer-contents (hash-ref

[racket-users] Nesting structs – I'm confused!

2016-02-23 Thread Gavin McGimpsey
I've been puzzling over this all evening – hoping someone can clarify what's going on. Here's a complete minimal example: https://gist.github.com/gavinmcgimpsey/05bfe26f039944f23a9c I think my question is: what's the proper way to update nested data like this? Gavin -- You received this

Re: [racket-users] Detect version of OS X

2016-02-23 Thread Stephen De Gabrielle
what about this? #lang racket/base (require racket/system racket/port) (substring (with-output-to-string (lambda () (system "sw_vers -productVersion"))) 3 5) I get "10" or "11" respectively, and I believe it will run on older versions OS X. s. On Tue, Feb 23, 2016 at 9:38 PM Jens

Re: [racket-users] Detect version of OS X

2016-02-23 Thread Jens Axel Søgaard
The system-type approach looks like this (it ignores the optional third version counter): (match (regexp-match #px".*Kernel Version ([\\d]+[.][\\d]+).*" (system-type 'machine)) [(list _ version-str) (string->number version-str)] [_ #f]) The expression returns 15.0 on my machine.

Re: [racket-users] slow rendering for 1000+ lines/arcs

2016-02-23 Thread Matthew Flatt
At Tue, 23 Feb 2016 08:49:11 -0800 (PST), copycat wrote: > If the problem is somehow related to going in and out of the drawing > layer, is it possible to batch the updates without using dc-path% and > draw-path%? Another kind of batching is `draw-lines` instead of `draw-line`, but that one

Re: [racket-users] Re: long (16s) pauses in UI associated with OS X, possibly app nap?

2016-02-23 Thread Matthew Flatt
At Tue, 23 Feb 2016 11:46:37 -0500, George Neuner wrote: > On Tue, 23 Feb 2016 08:06:34 -0700, Matthew Flatt > wrote: > > >At Mon, 22 Feb 2016 18:55:59 -0500, George Neuner wrote: > >> If you suspect App Nap, have you tried disabling it for DrRacket? > > > >That's worth a

Re: [racket-users] Detect version of OS X

2016-02-23 Thread Matthew Flatt
You could parse the result of `(system-type 'machine)`, but you might just as well use a little `ffi/unsafe` binding to get `NSAppKitVersionNumber`: #lang racket/base (require ffi/unsafe) (define appkit (ffi-lib "/System/Library/Frameworks/AppKit.framework/AppKit")) (define

[racket-users] Detect version of OS X

2016-02-23 Thread Jens Axel Søgaard
Hi All, The function system-type can be used to detect the system type. Is there a function that returns the version of the operating system? Use case: The paths to LaTeX has changed on El Capitan, which makes it difficult to choose a default path, that works for all. /Jens Axel -- You

Re: [racket-users] SEwPR PLT Redex code error? (pg 225)

2016-02-23 Thread Matthias Felleisen
My fault! On Feb 23, 2016, at 1:27 PM, Sam Caldwell wrote: > I am pretty sure it is a result of this change: > > https://groups.google.com/d/topic/racket-users/blV3EEkJxVk/discussion > > On Tue, Feb 23, 2016 at 1:23 PM, Matthias Felleisen > wrote:

Re: [racket-users] SEwPR PLT Redex code error? (pg 225)

2016-02-23 Thread Sam Caldwell
I am pretty sure it is a result of this change: https://groups.google.com/d/topic/racket-users/blV3EEkJxVk/discussion On Tue, Feb 23, 2016 at 1:23 PM, Matthias Felleisen wrote: > > This is must be a regression. The build-process for the second part > includes running the

Re: [racket-users] SEwPR PLT Redex code error? (pg 225)

2016-02-23 Thread Robby Findler
This is a backwards incompatibility that we discussed on this very mailing list, actually. The syntax error message I believe pinpoints the change that needs to be made to the model -- simply renaming the variables M and N should do the trick. Sorry for the inconvenience. Robby On Tue, Feb 23,

Re: [racket-users] SEwPR PLT Redex code error? (pg 225)

2016-02-23 Thread Matthias Felleisen
This is must be a regression. The build-process for the second part includes running the figures (and their tests). On Feb 23, 2016, at 1:09 PM, Andrew Kent wrote: > A student today pointed out the standard reduction definition for ISWIM on pg > 225 in SEwPR is broken: >

[racket-users] SEwPR PLT Redex code error? (pg 225)

2016-02-23 Thread Andrew Kent
A student today pointed out the standard reduction definition for ISWIM on pg 225 in SEwPR is broken: #lang racket (require redex) ;; iswim ;; definition from pg 217 (define-language iswim ((M N L K) X (λ X M) (M M) b (o2 M M) (o1 M)) (o o1 o2) (o1 add1 sub1 iszero) (o2 + - *) (b

Re: [racket-users] slow rendering for 1000+ lines/arcs

2016-02-23 Thread copycat
On Tuesday, February 23, 2016 at 9:42:27 PM UTC+8, Matthew Flatt wrote: > I see drawing times of around 60ms for "KCF new FIPG .. .dxf" on my > machine. I could reduce the time a little by calling `(get-dc)` just > once and passing it through all the drawing functions, but it looks > like a lot of

[racket-users] Re: long (16s) pauses in UI associated with OS X, possibly app nap?

2016-02-23 Thread George Neuner
On Tue, 23 Feb 2016 08:06:34 -0700, Matthew Flatt wrote: >At Mon, 22 Feb 2016 18:55:59 -0500, George Neuner wrote: >> If you suspect App Nap, have you tried disabling it for DrRacket? > >That's worth a try, but App Nap should be disabled automatically by the >`racket/gui`

Re: [racket-users] Strange behavior with highlight-range method from framework

2016-02-23 Thread Robby Findler
I think there are two things going on here. The first: when you type "(define (f x)" and highlight between the parens and then type a space, you are asking it to highlight "(f x) " and then you hit return, you are asking for "(f x) \n" to be circled, and same with any other characters you type.

Re: [racket-users] long (16s) pauses in UI associated with OS X, possibly app nap?

2016-02-23 Thread Matthew Flatt
At Mon, 22 Feb 2016 18:55:59 -0500, George Neuner wrote: > If you suspect App Nap, have you tried disabling it for DrRacket? That's worth a try, but App Nap should be disabled automatically by the `racket/gui` library that DrRacket uses. The library calls the `setActivationPolicy:` method of the

Re: [racket-users] slow rendering for 1000+ lines/arcs

2016-02-23 Thread Matthew Flatt
I see drawing times of around 60ms for "KCF new FIPG .. .dxf" on my machine. I could reduce the time a little by calling `(get-dc)` just once and passing it through all the drawing functions, but it looks like a lot of the remaining time is spent crossing into and out of the drawing layer at

Re: [racket-users] mutually linking between documentation of different packages

2016-02-23 Thread Matthew Flatt
At Tue, 23 Feb 2016 02:03:55 -0500, Neil Van Dyke wrote: > If there are two packages, "a" and "b", in the package catalog, and the > authors of both packages want their package's documentation to have > hyperlinks to sections of the other package's documentation... > > Will that work? Is it OK