Re: [racket] Requiring SRFI

2012-11-01 Thread Mark Engelberg
OK, I get it now. subtract-in does exactly what I want. Thanks, Mark Racket Users list: http://lists.racket-lang.org/users

Re: [racket] (no subject)

2012-11-01 Thread Neil Van Dyke
Cool. Have you tried putting these in PLaneT yet, so people can find and easily use them in the future? (Putting a package into PLaneT is easier with McFly Tools, if that helps. "http://www.neilvandyke.org/mcfly-tools/";) Neil V. Racket Users list: http://lists.racke

Re: [racket] Evaluating a module with an unintended language

2012-11-01 Thread Jordan Johnson
Matthias Felleisen wrote: > >I can't think of another way. But I am also wondering why you'd want to >run a program written in language L in language K. -- Matthias Mostly I just wondered how easy it would be to do it. (Certainly the toy examples I made were things one could doubtless impleme

[racket] Racket macros that run on files

2012-11-01 Thread Patrick Mahoney
Hello all, Is there a package out there wherein a user can specify a syntax transformer, and the macro expansions are used to replace invocations of the syntax transformer in the source syntax, within the source file itself. I guess I'm envisioning a sort of syntax aware find and replace. Thanks,

[racket] (no subject)

2012-11-01 Thread Edward Blake
Hello Racketeers, I'm just introducing myself to the list. I've written a few projects in Racket over the last few years and just lately decided to post them on GitHub. https://github.com/edwardlblake/ There's a (unfinished) IRC client app with a internal routing system (I'm intending to have a

Re: [racket] Evaluating a module with an unintended language

2012-11-01 Thread Eli Barzilay
An hour ago, Matthias Felleisen wrote: > I can't think of another way. But I am also wondering why you'd want > to run a program written in language L in language K. -- Matthias I had that at some point for code that would either get treated as plain racket or as code in lazy racket. (With the ob

Re: [racket] Evaluating a module with an unintended language

2012-11-01 Thread Matthias Felleisen
I can't think of another way. But I am also wondering why you'd want to run a program written in language L in language K. -- Matthias p.s. To think of (define (hi person) ...) as a program is wrong. You should look at the file proper where you will see the extra lines that your reader acc

Re: [racket] Typed Racket: Parametricity foils equality checking?

2012-11-01 Thread Sam Tobin-Hochstadt
On Thu, Nov 1, 2012 at 4:56 PM, John Clements wrote: > I can't tell whether this is a bug. In the program below, remove-duplicates doesn't remove duplicates. This looks like an attempt to preserve parametricity a la theorems for free, but I don't think that TR actually tries to guarantee parametri

[racket] Evaluating a module with an unintended language

2012-11-01 Thread Jordan Johnson
Looking at some of the recent tutorials on building and using languages in Racket, I was prompted to wonder what I'd have to do in order to take an existing module (in its own file) and evaluate it with a language other than the one it is specified to use, without modifying the module's original so

Re: [racket] Typed Racket: Parametricity foils equality checking?

2012-11-01 Thread Matthias Felleisen
Thank you, thank you, thank you. [This validates that my objection to our parametricity is real.] On Nov 1, 2012, at 4:56 PM, John Clements wrote: > I can't tell whether this is a bug. In the program below, remove-duplicates > doesn't remove duplicates. This looks like an attempt to preser

Re: [racket] monochrome bitmaps

2012-11-01 Thread Harry Spier
Matthew Flatt wrote: > A monocrhome bitmap doesn't have an alpha channel, but it you ask for > its pixels in `just-alpha?' mode, then while pixels generate a 0 alpha > and black pixels generate a 255 alpha. > Thanks Matthew. What confused me was that for: (send a-dc set-alpha opacity) opacity i

Re: [racket] Typed Racket: Parametricity foils equality checking?

2012-11-01 Thread Ray Racine
Interestingly (require/typed racket [remove-duplicates ((Listof Any) -> (Listof Any)))]) works. On Thu, Nov 1, 2012 at 4:56 PM, John Clements wrote: > I can't tell whether this is a bug. In the program below, > remove-duplicates doesn't remove duplicates. This looks like an att

[racket] Typed Racket: Parametricity foils equality checking?

2012-11-01 Thread John Clements
I can't tell whether this is a bug. In the program below, remove-duplicates doesn't remove duplicates. This looks like an attempt to preserve parametricity a la theorems for free, but I don't think that TR actually tries to guarantee parametricity in this sense. I'm guessing that the values in

Re: [racket] DRRacket right-click menu fragility in Linux.

2012-11-01 Thread Vincent St-Amour
I'm having similar issues on Debian squeeze and wheezy and Ubuntu 12.04. Vincent At Thu, 1 Nov 2012 16:32:30 -0400, Ray Racine wrote: > > [1 ] > [1.1 ] > When editing racket code in DR the right-click menu is very fragile on > Linux (Ubuntu 12.10). Upon right-clicking the menu pops up, but m

[racket] DRRacket right-click menu fragility in Linux.

2012-11-01 Thread Ray Racine
When editing racket code in DR the right-click menu is very fragile on Linux (Ubuntu 12.10). Upon right-clicking the menu pops up, but more often then not quite promptly vanishes. I can't pin down a repeatable set of conditions. Sometimes I can't get it to stay open at all, other times if I righ

[racket] The PLoT library is excellent

2012-11-01 Thread David Van Horn
Thank you, Neil T., for making such an awesome library. David Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Requiring SRFI

2012-11-01 Thread Gregory Woodhouse
Why not important the SRFI library with a prefix? Sent from my iPhone On Nov 1, 2012, at 11:43 AM, Mark Engelberg wrote: > Thanks. Is there a simple way to do it without itemizing the specific > function names? > > I was caught off guard because I was using the new string-trim function. >

Re: [racket] Requiring SRFI

2012-11-01 Thread Gregory Woodhouse
One potential issue is that the Racket and SRFI functions may take different arguments or have different semantics. Sent from my iPhone On Nov 1, 2012, at 11:43 AM, Mark Engelberg wrote: > Thanks. Is there a simple way to do it without itemizing the specific > function names? __

Re: [racket] Requiring SRFI

2012-11-01 Thread Carl Eastlund
You don't have to itemize any names. Just put the name after the #lang line. I assume that's racket, but it might be racket/base. You don't need to list anything else you include, require will already report an error if those clash. Carl Eastlund On Thu, Nov 1, 2012 at 2:45 PM, Mark Engelberg

Re: [racket] DRRacket Check Syntax Loops Endlessly (Sample Provided)

2012-11-01 Thread Sam Tobin-Hochstadt
On Thu, Nov 1, 2012 at 2:46 PM, Matthias Felleisen wrote: > > Since S0 is a function from T :: Type to some Union and TR doesn't allow > this, you want to signal a syntax error here. Correct? No, this program is fine from a typed perspective. The only problem is in contract generation, which lo

Re: [racket] Requiring SRFI

2012-11-01 Thread Eli Barzilay
A few minutes ago, Mark Engelberg wrote: > Thanks.  Is there a simple way to do it without itemizing the > specific function names? The two things in the form are two require specs, and you get everything from the first that is not provided by the second -- you don't need to list any names. --

Re: [racket] DRRacket Check Syntax Loops Endlessly (Sample Provided)

2012-11-01 Thread Matthias Felleisen
Since S0 is a function from T :: Type to some Union and TR doesn't allow this, you want to signal a syntax error here. Correct? On Nov 1, 2012, at 12:16 PM, Sam Tobin-Hochstadt wrote: > On Thu, Nov 1, 2012 at 12:07 PM, Ray Racine wrote: >> Fresh build from Racket git MASTER, the following ca

Re: [racket] Requiring SRFI

2012-11-01 Thread Carl Eastlund
What Eli linked should do that, just write: (require (subtract-in srfi/13 racket)) That should require everything that's in srfi/13, except for names that are already in racket. Carl Eastlund On Thu, Nov 1, 2012 at 2:43 PM, Mark Engelberg wrote: > Thanks. Is there a simple way to do it witho

Re: [racket] Requiring SRFI

2012-11-01 Thread Mark Engelberg
My point being that I'm worried if I have to itemize all the names, I might miss a potential conflict. On Thu, Nov 1, 2012 at 11:43 AM, Mark Engelberg wrote: > Thanks. Is there a simple way to do it without itemizing the specific > function names? > > I was caught off guard because I was using t

Re: [racket] Requiring SRFI

2012-11-01 Thread Mark Engelberg
Thanks. Is there a simple way to do it without itemizing the specific function names? I was caught off guard because I was using the new string-trim function. When I included srfi/13, I didn't realize it was going to replace string-trim with a version that was really just a "trim left" function.

Re: [racket] Requiring SRFI

2012-11-01 Thread Eli Barzilay
http://docs.racket-lang.org/reference/require.html#(form._((lib._racket/require..rkt)._subtract-in)) 20 minutes ago, Mark Engelberg wrote: > Is there an easy way to require everything in a given SRFI, while > specifying that in a case of name conflict, I want to use the > built-in racket version?

[racket] Requiring SRFI

2012-11-01 Thread Mark Engelberg
Is there an easy way to require everything in a given SRFI, while specifying that in a case of name conflict, I want to use the built-in racket version? I'm specifically thinking about srfi/13, the string library. I want to include that, but I think Racket's newly added string functions (such as

Re: [racket] Losing decimal in SQL Server query result

2012-11-01 Thread Galler
> > Another possible workaround for now would be to cast the field to a > varchar and call string->number on the result. > numeric is an exact datatype in SQL Server; you'd also want to compose inexact->exact with string->number to preserve exactness (if that's a concern) i.e (inexact->exact

Re: [racket] DRRacket Check Syntax Loops Endlessly (Sample Provided)

2012-11-01 Thread Ray Racine
Thanks, I did catch that, was just pointing out the non-termination. The original source file was much larger and it took awhile to pare it down to the root cause. Definitely a non-showstopper issue however. On Thu, Nov 1, 2012 at 12:16 PM, Sam Tobin-Hochstadt wrote: > On Thu, Nov 1, 2012 at

Re: [racket] DRRacket Check Syntax Loops Endlessly (Sample Provided)

2012-11-01 Thread Sam Tobin-Hochstadt
On Thu, Nov 1, 2012 at 12:07 PM, Ray Racine wrote: > Fresh build from Racket git MASTER, the following causes DRRacket's Check > Syntax to loop without termination. Clearly, this isn't the behavior you want, but I don't think a contract is possible to generate for this code. If you change the ty

[racket] DRRacket Check Syntax Loops Endlessly (Sample Provided)

2012-11-01 Thread Ray Racine
Fresh build from Racket git MASTER, the following causes DRRacket's Check Syntax to loop without termination. #lang typed/racket/base (provide f) (struct: (T) S1 ([x : (Listof String)])) (struct: (T) S2 ([x : S0] [g : (T -> Boolean)])) (define-type (S0 T) (U (S1 T) (S2 T))) (

Re: [racket] monochrome bitmaps

2012-11-01 Thread Matthew Flatt
At Wed, 31 Oct 2012 23:06:39 -0400, Harry Spier wrote: > Dear list members, > > I see from the Racket Drawing Toolkit documentation that there are > monochrome bitmaps but I'm not clear from the documentation how to > access and manipulate these monochrome bitmaps. > > Specifically: > 1) If I loa

Re: [racket] Losing decimal in SQL Server query result

2012-11-01 Thread Greg Graham
Thank you, Ryan! The cast as numeric(10,4) did not work, but the cast to varchar worked fine, and that's good enough for me for now. I have no idea why this field is sized so big, but this is not the first puzzling thing I've seen in this database. Let me know if there is anything else I do to h