[racket-users] inconsistency/bug in math/array

2015-10-21 Thread Berthold Bäuml
When using array-slice-ref from math/array I get different results when executing it #lang typed/racket or #lang racket (see below). The typed/racket result is consistent with the documentation, the untyped one seems to be wrong. Berthold #lang typed/racket (require math/array) (define arr

Re: [racket-users] Testing environment variable changes

2015-10-21 Thread Jack Firth
On Tuesday, October 20, 2015 at 11:56:33 AM UTC-7, Tim Brown wrote: > I'm not sure if I'd want to be able to arbitrarily change > current-proxy-servers on the fly (something that has proven difficult, > highlighted by the hoops I have to jump through in the tests). On the other > hand it's

Re: [racket-users] inconsistency/bug in math/array

2015-10-21 Thread Ryan Culpepper
I think I've run into this problem before. The type of array-slice-ref is (Array A) (Listof Slice-Spec) -> (Array A) where Slice-Spec = (U (Sequenceof Integer) Integer ) The problem is that integers are also sequences, so the contract generated for Slice-Spec just discards the Integer

Re: [racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Robby Findler
Well, one part of the answer is that DrRacket indents empty lines so when type something like "(define (f x)x" the second "x" is in a reasonable place. Perhaps it could behave differently, but auto-indent-on-return seems less surprising than

[racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Paolo Giarrusso
Hi all! Every time I reindent a file with DrRacket in a Git repository, DrRacket and Git fight over whitespace. Git assumes that spaces at the end of lines are whitespace errors, while DrRacket indentation will add spaces to empty lines (including existing ones), if they are inside parens

Re: [racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Alexis King
This might be a relevant thread: https://groups.google.com/d/msg/racket-users/5pxs1pM-8lE/uh0yn9D0QHYJ (It also might not be. I’m not really sure if it addresses your issue or not.) > On Oct 21, 2015, at 12:47 PM, Paolo Giarrusso wrote: > > Hi all! > > Every time I

[racket-users] Opening .rktd files in DrRacket

2015-10-21 Thread Paolo Giarrusso
Every time I open a .rktd file in DrRacket 6.2.1, I get an error shown, because rktd files don't contain #lang. Googling found nothing, and I didn't find a #lang data. At best, I can add #lang s-exp syntax/module-reader, but those .rktd files won't work unless I change the reading applications.

Re: [racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Jon Zeppieri
DrWhitespace will certainly remove spaces from empty non-top-level lines. (And from other places, as well.) -J On Wed, Oct 21, 2015 at 4:23 PM, Alexis King wrote: > This might be a relevant thread: > https://groups.google.com/d/msg/racket-users/5pxs1pM-8lE/uh0yn9D0QHYJ >

Re: [racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Vincent St-Amour
FWIW, I believe what emacs does (or maybe it's configurable?) is to delete trailing whitespace when a newline is inserted. That way, if you start a new line, it will be indented as it should, and if you press enter again to leave the line blank, that indentation just goes away and you get a true

[racket-users] Strange garbage collection behavior with closures

2015-10-21 Thread Scott Moore
I’m trying to do something a bit fancy that makes use of weak-hashes, but I’ve run into strange behavior (things not being removed that I believe should be) when I use keys that are closures. Doing some of my own debugging, this doesn’t appear specific to weak hashes, but also to weak boxes.

Re: [racket-users] Strange garbage collection behavior with closures

2015-10-21 Thread Matthew Flatt
An empty closure is allocated as a constant --- similar to a literal string or literal fraction in your program. The "closure" will stick around as long as the code does, and the code will stick around as the namespace where its loaded. If you change `(λ () 0`) to `(λ () (if box 0 'huh?))`, then

Re: [racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Paolo Giarrusso
On 22 October 2015 at 01:59, Robby Findler wrote: > Just for the record, what Vincent describes below is what DrRacket > does (by default). The problem is that not everyone then hits return a > second time. Thanks, I had never figured! Each programmer editor I know

Re: [racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Robby Findler
Just for the record, what Vincent describes below is what DrRacket does (by default). The problem is that not everyone then hits return a second time. Robby On Wed, Oct 21, 2015 at 3:45 PM, Vincent St-Amour wrote: > FWIW, I believe what emacs does (or maybe it's