Re: [racket] specifying types for fields in non-polymorphic structures

2014-04-25 Thread Alexander D. Knauth
Then is there something like and/c for types? (like U is like or/c for types) That could probably solve it. It seems like typed racket is already doing this in some cases, for example: #lang typed/racket (define positive-real? (make-predicate Positive-Real)) (define (f x) (if (positive-real

Re: [racket] specifying types for fields in non-polymorphic structures

2014-04-25 Thread Sam Tobin-Hochstadt
What you're looking for is called bounded polymorphism. Sadly, Typed Racket doesn't support this, so I'd try one of the options David suggests. Sam On Apr 25, 2014 10:46 PM, "Alexander D. Knauth" wrote: > That’s what I tried at first, but my actual struct is a lot more > complicated than posn, a

Re: [racket] specifying types for fields in non-polymorphic structures

2014-04-25 Thread Alexander D. Knauth
That’s what I tried at first, but my actual struct is a lot more complicated than posn, and it kept giving be type-check errors, and trying to enforce the types of the fields myself just ended up with completely unreadable code and even more type errors, so I gave up on making it polymorphic, bu

Re: [racket] specifying types for fields in non-polymorphic structures

2014-04-25 Thread David Van Horn
On 4/25/14, 9:57 PM, Alexander D. Knauth wrote: > But then the posn constructor doesn’t enforce that it’s arguments have to be > Reals, and the posn? predicate doesn’t check it, and the accessors don’t say > that they always produce Reals. Maybe I'm not seeing the big picture, but that's what

Re: [racket] specifying types for fields in non-polymorphic structures

2014-04-25 Thread Alexander D. Knauth
But then the posn constructor doesn’t enforce that it’s arguments have to be Reals, and the posn? predicate doesn’t check it, and the accessors don’t say that they always produce Reals. On Apr 25, 2014, at 9:49 PM, David Van Horn wrote: > How about this? > > (struct: (x y) posn ([x : x] [y

Re: [racket] specifying types for fields in non-polymorphic structures

2014-04-25 Thread David Van Horn
On 4/25/14, 9:38 PM, Alexander D. Knauth wrote: > Is there a way of specifying types for fields in non-polymorphic structures? > Like this: > (struct: posn ([x : Real] [y : Real])) > (define-type Origin > (posn Zero Zero)) > I know this doesn’t work, but is there something that could work like

[racket] specifying types for fields in non-polymorphic structures

2014-04-25 Thread Alexander D. Knauth
Is there a way of specifying types for fields in non-polymorphic structures? Like this: (struct: posn ([x : Real] [y : Real])) (define-type Origin (posn Zero Zero)) I know this doesn’t work, but is there something that could work like it? By the way is there any reason why the same posn type

Re: [racket] Plot silently fails for some characters in y-label

2014-04-25 Thread Deren Dohoda
Neil, Thanks for the help, the report is submitted. Deren On Fri, Apr 25, 2014 at 9:12 PM, Neil Toronto wrote: > Can you submit a bug report from DrRacket? (Use "Submit Bug Report..." in > the Help menu.) That way, we'll have your system information automatically > attached to the PR in the bu

Re: [racket] Plot silently fails for some characters in y-label

2014-04-25 Thread Neil Toronto
Can you submit a bug report from DrRacket? (Use "Submit Bug Report..." in the Help menu.) That way, we'll have your system information automatically attached to the PR in the bug database. Make the title something like "Drawing rotated unicode text breaks device contexts on Windows 7." Thanks

Re: [racket] Plot silently fails for some characters in y-label

2014-04-25 Thread Deren Dohoda
Hi Neil, I have the 32-bit version installed on my Win7 machine at home, too. I was able to reproduce my own problem here as well. When I run your example, the first plot looks like I'd expect. The second one does not have the circle. If I remove the \circ from the text-extent it doesn't change a

Re: [racket] Plot silently fails for some characters in y-label

2014-04-25 Thread Kieron Hardy
I can replicate the original problem (Racket 5.3.6 32-bit on Win7 64-bit). The new plot has problems also - see attached. Kieron. On Fri, Apr 25, 2014 at 4:39 PM, Neil Toronto wrote: > I can't replicate this problem on my machine, so I'll need more > information. Can you run the following prog

Re: [racket] Plot silently fails for some characters in y-label

2014-04-25 Thread Neil Toronto
I can't replicate this problem on my machine, so I'll need more information. Can you run the following program and reply with what you see? #lang racket (require racket/draw plot) (plot (function sin #e1e-157 #e1e-156)) (define bm (make-bitmap 400 400)) (define dc (make-object bitmap-dc% bm)

[racket] Plot silently fails for some characters in y-label

2014-04-25 Thread Deren Dohoda
Short story: put a \circ in the y-label and plotting fails? Racket 6.0 32-bit on 64-bit Windows 7. Using DrRacket. The plot frame is generated, the plot title and x-label appear, the tick marks on the axes appear, but the y-label doesn't appear and neither (points ...) nor (function ...) appear.

Re: [racket] Help with sockets.

2014-04-25 Thread Greg Hendershott
> Thanks, with sendall it works nicely. > But when I try the reverse flow(that is, Racket to Python) making: > ;... > (display "Hello" s-out) > ;or with 'print > Python doesn't read with recv(500) > > it locks the terminal... Probably this is also due to buffering. After: (display "

Re: [racket] Introducing Blight - A Tox Client in Racket

2014-04-25 Thread Lehi Toskin
On Thu, 17 Apr 2014 20:48:04 +, Lehi Toskin wrote: > I've recently started programming a GUI client for Tox (http://tox.im), > a GPLv3+ licensed, totally distributed, P2P secure instant messenger > that aims to supplant Skype in all areas: text, voice, and video. Blight > is in early developme

Re: [racket] Type info lost for required function used in Racket REPL... but DrRacket REPL is OK?

2014-04-25 Thread Greg Hendershott
Great! 1. I pushed this for racket-mode. https://github.com/greghendershott/racket-mode/commit/c782dbb23eced63d51cf58b4c3d9f80afb0206ff 2. I submitted a PR to change `enter!`. https://github.com/plt/racket/pull/626 Racket Users list: http://lists.racket-lang.org/us