Re: [racket] I think I found a bug in the JITC

2012-01-30 Thread Erik Dominikus
Only 3 hours from report to fix. That's quite impressive. :-D @Marijn: I forgot... my platform is Ubuntu 10.04 Linux 2.6.32-38 x86_64. Still learning to write bug reports I guess. :-| Once again, thanks! ~ sorry if the response seems to be coming at a weird time; I'm on the other side of the wo

Re: [racket] table layout for panel%

2012-01-30 Thread Doug Williams
I have a table-panel% class on PLaneT - table-panel.plt. On Monday, January 30, 2012, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I was wondering if anyone had already written code for a panel% that > lays out its elements in a grid similar to how a html table's el

Re: [racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread Sam Tobin-Hochstadt
On Mon, Jan 30, 2012 at 6:02 PM, Matthias Felleisen wrote: > > On Jan 30, 2012, at 6:00 PM, John Clements wrote: > >> >> On Jan 30, 2012, at 1:14 PM, Matthias Felleisen wrote: >> >>> >>> On Jan 30, 2012, at 4:11 PM, Sam Tobin-Hochstadt wrote: >>> Perhaps it should just have less information.

Re: [racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread Matthias Felleisen
On Jan 30, 2012, at 6:00 PM, John Clements wrote: > > On Jan 30, 2012, at 1:14 PM, Matthias Felleisen wrote: > >> >> On Jan 30, 2012, at 4:11 PM, Sam Tobin-Hochstadt wrote: >> >>> Perhaps it should just have less information. >> >> >> I like that a lot. > > I'm not sure I do; if I were on

Re: [racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread John Clements
On Jan 30, 2012, at 1:14 PM, Matthias Felleisen wrote: > > On Jan 30, 2012, at 4:11 PM, Sam Tobin-Hochstadt wrote: > >> Perhaps it should just have less information. > > > I like that a lot. I'm not sure I do; if I were on a desert island or had just kicked Sam in the shin yesterday, I'd p

Re: [racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread Matthias Felleisen
On Jan 30, 2012, at 4:11 PM, Sam Tobin-Hochstadt wrote: > Perhaps it should just have less information. I like that a lot. Racket Users list: http://lists.racket-lang.org/users

Re: [racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread Sam Tobin-Hochstadt
On Mon, Jan 30, 2012 at 4:04 PM, Matthias Felleisen wrote: > > And what do you say to this: > >> I admit that that error just makes my eyes glaze over, but I'm pretty sure >> that the problem here is that TR can't reduce this filter type, and just >> needs a cleverness injection. Unfortunately,

Re: [racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread Matthias Felleisen
And what do you say to this: > I admit that that error just makes my eyes glaze over, but I'm pretty sure > that the problem here is that TR can't reduce this filter type, and just > needs a cleverness injection. -- Matthias On Jan 30, 2012, at 3:54 PM, Sam Tobin-Hochstadt wrote: >

Re: [racket] Typed Racket can't filter non-false yet?

2012-01-30 Thread Sam Tobin-Hochstadt
On Mon, Jan 30, 2012 at 3:54 PM, John Clements wrote: > > On Jan 30, 2012, at 12:53 PM, Sam Tobin-Hochstadt wrote: > >> On Mon, Jan 30, 2012 at 3:37 PM, Sam Tobin-Hochstadt >> wrote: >>> On Mon, Jan 30, 2012 at 3:22 PM, John Clements >>> wrote: Am I missing something obvious in either of t

Re: [racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread Sam Tobin-Hochstadt
On Mon, Jan 30, 2012 at 3:48 PM, John Clements wrote: > > Looking at this, though, it seems to me that it might be simpler just to ask > TR to construct a filter for a given type, and it occurs to me that this > might already be built-in.  If so, I can't find it in the documentation. What you w

Re: [racket] Typed Racket can't filter non-false yet?

2012-01-30 Thread John Clements
On Jan 30, 2012, at 12:53 PM, Sam Tobin-Hochstadt wrote: > On Mon, Jan 30, 2012 at 3:37 PM, Sam Tobin-Hochstadt > wrote: >> On Mon, Jan 30, 2012 at 3:22 PM, John Clements >> wrote: >>> Am I missing something obvious in either of these? >> >> No. Typed Racket doesn't have type subtraction, wh

Re: [racket] Typed Racket can't filter non-false yet?

2012-01-30 Thread Sam Tobin-Hochstadt
On Mon, Jan 30, 2012 at 3:37 PM, Sam Tobin-Hochstadt wrote: > On Mon, Jan 30, 2012 at 3:22 PM, John Clements > wrote: >> Am I missing something obvious in either of these? > > No.  Typed Racket doesn't have type subtraction, which is what you > need in the first case. I'm not sure why the second

[racket] constructing a boolean that's a filter for a given type? could be automatic?

2012-01-30 Thread John Clements
I'm finding it difficult to construct filters for given types: #lang typed/racket (define-type GradeElement (Pair Bytes Null)) (: grade-element? (Any -> Boolean : GradeElement)) (define (grade-element? a) (and (pair? a) (bytes? (car a)) (null? (cdr a => Type Checker: Exp

Re: [racket] Typed Racket can't filter non-false yet?

2012-01-30 Thread Sam Tobin-Hochstadt
On Mon, Jan 30, 2012 at 3:22 PM, John Clements wrote: > Am I missing something obvious in either of these? No. Typed Racket doesn't have type subtraction, which is what you need in the first case. I'm not sure why the second case isn't working right; I think the type of `filter' is a little too

[racket] Typed Racket can't filter non-false yet?

2012-01-30 Thread John Clements
I want to write this piece of code: (: only-non-false (All (T) ((Listof (U T False)) -> (Listof T (define (only-non-false l) (filter (ann (lambda (x) x) ((U T False) -> Any : T)) l)) ... but Typed Racket says: Type Checker: Expected result with filter ((T @ x) | (!

Re: [racket] text-field% isn't just for string input, but for output and numbers too!

2012-01-30 Thread Matthew Flatt
A note on alignment: The `text%' class supports 'right and 'center paragraph alignment, which more or less works when the editor has a maximum width. (The docs have some caveats.) So, you can get right-alignment to a useful degree with a sequence like this: (define tf (new text-field% ))

Re: [racket] I think I found a bug in the JITC

2012-01-30 Thread Matthew Flatt
The bug turned out to be in the bytecode compiler, which in some cases could lose track of the fact that a variable captured by a closure has a flonum value. The lost information was needed only by the JIT, but compiling your example to bytecode and attempting to load it would also provoke an error

Re: [racket] text-field% isn't just for string input, but for output and numbers too!

2012-01-30 Thread Matthias Felleisen
May I propose an experiment? While I think that this is a perfectly legitimate request, I am also wondering whether Matthew's port of the GUI library to Racket has improved our user's ability to look at the code and to propose a fix. You might consider posting it here for discussion first befo

Re: [racket] I think I found a bug in the JITC

2012-01-30 Thread Matthew Flatt
I can replicate the error in my build, and I'm working on it. At Mon, 30 Jan 2012 15:57:32 +0100, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 30-01-12 15:21, Erik Dominikus wrote: > > Source code for reproducing attached. 'racket --version' shows > > 5.2. I built from s

[racket] table layout for panel%

2012-01-30 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I was wondering if anyone had already written code for a panel% that lays out its elements in a grid similar to how a html table's elements are laid out. Marijn -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG

Re: [racket] I think I found a bug in the JITC

2012-01-30 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30-01-12 15:21, Erik Dominikus wrote: > Source code for reproducing attached. 'racket --version' shows > 5.2. I built from source. > > The expected result is a list, but Racket gave this error message > instead: > > > internal error: flonum posi

[racket] I think I found a bug in the JITC

2012-01-30 Thread Erik Dominikus
Source code for reproducing attached. 'racket --version' shows 5.2. I built from source. The expected result is a list, but Racket gave this error message instead: internal error: flonum position not found === context === /kage/racket-5.2/collects/racket/private/stream-cons.rkt:42:0: stream-fo

[racket] text-field% isn't just for string input, but for output and numbers too!

2012-01-30 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, when you disable a text-field% `tf' (send tf enable #f), the label is greyed out and the field part doesn't accept the cursor or any other form of user input. This is useful when you need an input field which should not always be available. When y