Re: [racket] Compiling a program with places

2011-10-13 Thread Sam Tobin-Hochstadt
On Thu, Oct 13, 2011 at 8:14 AM, Matthew Flatt wrote: > > Another possibility is to use the `place' form instead of > `dynamic-place'. The new Guide section (which I see is not linked as it > should be from the Reference section) provides an example using > `place': A couple more examples using t

Re: [racket] Saving and restoring many parameters

2011-10-20 Thread Sam Tobin-Hochstadt
But without this bug, I never would have learned how to use 'gdb --pid=...'. ;) On Thu, Oct 20, 2011 at 8:41 AM, Robby Findler wrote: > Perhaps worth pointing out: this PR > >   http://bugs.racket-lang.org/query/?cmd=view&pr=12280 > > is an example of how getting an unexpected parameter setting c

Re: [racket] [typed racket] typing monads

2011-10-20 Thread Sam Tobin-Hochstadt
On Thu, Oct 20, 2011 at 10:45 AM, Eric Tanter wrote: > Hi, > > Is there a way to type a monad? > > For example in OCaml: > > module type MonadRequirements = sig >    type ‘a t >    val bind : ‘a t -> (‘a -> ‘b t) -> ‘b t >    val return : ‘a -> ‘a t > end;; > > In Typed Racket we can use a polymor

Re: [racket] [typed racket] type case

2011-10-20 Thread Sam Tobin-Hochstadt
There are basically two options here: 1. If you just use `cond' with no `else', you get a type error when your cases are not exhaustive. For example: (: f ((U String Integer) -> Boolean)) (define (f x) [(string? x) (string=? x "hi")] [(exact-nonnegative-integer? x) (= x 7)]) This program wil

Re: [racket] [typed racket] type case

2011-10-20 Thread Sam Tobin-Hochstadt
;core" Racket, it's not even clear what exhaustiveness would mean in that case. > -Ian > ----- Original Message - > From: Sam Tobin-Hochstadt > To: Eric Tanter > Cc: Racket Users > Sent: Thu, 20 Oct 2011 14:39:19 -0400 (EDT) > Subject: Re: [racket] [typed rac

Re: [racket] [typed racket] typing monads

2011-10-20 Thread Sam Tobin-Hochstadt
On Thu, Oct 20, 2011 at 2:52 PM, Eric Tanter wrote: > Thanks Sam, > > Actually, that's not what we're after. > > In untyped Racket, we have a struct monad: > > (struct monad >  (;; A -> M A >   return >   ;; A -> (A -> M B) -> M B >   bind)) > > Then we have several instantiations (exception, stat

Re: [racket] [typed racket] type case

2011-10-21 Thread Sam Tobin-Hochstadt
it would greatly complicate the interaction between typed and untyped programs.Instead, I think Typed Racket should work with the Racket numeric tower, struct properties, and the Racket class system. So far, I haven't seen any strong reasons why Typed Racket would need to take a different approa

Re: [racket] [typed racket] type case

2011-10-22 Thread Sam Tobin-Hochstadt
On Sat, Oct 22, 2011 at 2:20 PM, Eric Tanter wrote: > On Oct 21, 2011, at 1:55 PM, Sam Tobin-Hochstadt wrote: >> On Fri, Oct 21, 2011 at 12:44 PM, Eric Tanter wrote: >>> In that sense, union types are a particularly good example. They are >>> necessary to support th

Re: [racket] impersonators/chaperones for lists

2011-10-22 Thread Sam Tobin-Hochstadt
On Sat, Oct 22, 2011 at 4:10 PM, Shriram Krishnamurthi wrote: > I'm missing why there are impersonators and chaperones for various > datatypes but not for lists.  There's surely a good reason why, but I > am having trouble reconstructing what it might be.  Anyone? First, chaperones aren't necess

Re: [racket] impersonators/chaperones for lists

2011-10-22 Thread Sam Tobin-Hochstadt
On Sat, Oct 22, 2011 at 5:50 PM, Shriram Krishnamurthi wrote: > Thanks to you and Sam -- I had wondered if the run-time system wasn't > partly driving this, and certainly chaperones on immutable data don't > make as much sense. They do make sense, and turn out to be important for things like imm

Re: [racket] [typed racket] type case

2011-10-23 Thread Sam Tobin-Hochstadt
On Sun, Oct 23, 2011 at 11:03 AM, Eric Tanter wrote: > So this seems the good way to go. > > However, of course, this does not work if the return type is compatible with > Void: > > (: f ((U String Integer) -> Any)) > (define (f x) >  (cond >    [(string? x) (string=? x "hi")] >    [(exact-nonneg

Re: [racket] [typed racket] type case

2011-10-25 Thread Sam Tobin-Hochstadt
On Sun, Oct 23, 2011 at 1:39 PM, Sam Tobin-Hochstadt wrote: > > Yes, I have planned to do this for a while.  Probably the form it will > take will be a macro that always produces a type error when checked, > rather than a new type.  Then macros could use this form to ensure >

Re: [racket] Vertical split

2011-10-28 Thread Sam Tobin-Hochstadt
In the preferences window, under the "General" tab, select "Put interactions window beside the definitions window". On Fri, Oct 28, 2011 at 2:05 PM, Jordan Johnson wrote: > Hi all, > > Quick question:  Is there any way to change the Interactions/Definitions > split > in DrRacket to be a vertical

Re: [racket] Just how to get and print a web page

2011-10-29 Thread Sam Tobin-Hochstadt
On Sat, Oct 29, 2011 at 4:27 AM, MingQian Zhang wrote: > Hi all: > I am a rookie to racket who used to write some ruby scripts. > Now I meet some problem about how to download a URL and print it or deal the > result as a String. > I write like this: > #lang racket > (require net/url) > (define (ge

Re: [racket] [typed] filters

2011-11-02 Thread Sam Tobin-Hochstadt
On Wed, Nov 2, 2011 at 12:56 PM, Eric Tanter wrote: > Hi, > > Looking at the ICFP'10 paper on logical types, I tried the following: > > (: carnum? ((Pairof Any Any) -> Boolean : (Pairof Number Any))) > (define (carnum? p) >  (number? (car p))) > > Type Checker: Expected result > with filter (((Pai

Re: [racket] Control indentation

2011-11-06 Thread Sam Tobin-Hochstadt
2011/11/6 José Lopes : > > Changing the default indentation is considered a good practice? I mean to > enforce to others users? > Or is it preferable to leave indentation as is. If you introduce a new form using macros, it's often useful to come up with an indentation rule for it. Almost always,

Re: [racket] [typed] optional parameter

2011-11-11 Thread Sam Tobin-Hochstadt
On Fri, Nov 11, 2011 at 6:22 AM, Eric Tanter wrote: > > but if I annotate g using case->, the same error happens: > > (: g (case-> (-> Number) (Number -> Number))) > (define (g [x 10]) >  x) > > Type Checker: Expected Number, but got Any in: (define (g (x 10)) x) > > Can someone explain why this e

Re: [racket] DrRacket needs work

2011-11-12 Thread Sam Tobin-Hochstadt
On Sat, Nov 12, 2011 at 10:05 PM, Raoul Duke wrote: > > so i might be totally the wrong audience because i can't stomach > trying to get to the stuff that is under the skin-deep-ugly to the > deeper way cool powerful technology. We, and in particular Robby, have put a lot of effort into making Dr

Re: [racket] DrRacket needs work

2011-11-14 Thread Sam Tobin-Hochstadt
They have successfully inserted thousands of square brackets for me. :) What are you doing that doesn't work? On Mon, Nov 14, 2011 at 6:06 AM, Eric Tanter wrote: > Nice! > > but automatic parentheses does not seem to work with square brackets. > > -- Éric > > > On Nov 13, 2011, at 10:42 AM, Robb

Re: [racket] DrRacket needs work

2011-11-14 Thread Sam Tobin-Hochstadt
- activate the automatic parentheses option > >  then: > > type `(' > --> () > > type `let (' > --> (let ()) > > type `[' > --> (let ([)) > > Here I would have expected > --> (let ([])) > > ? > > -- Éric > > > On Nov 14

Re: [racket] DrRacket needs work

2011-11-14 Thread Sam Tobin-Hochstadt
On Mon, Nov 14, 2011 at 9:11 PM, Robby Findler wrote: > Also, does anyone know if the license: > >  http://creativecommons.org/licenses/by-sa/3.0/ > > conflict with how we distribute Racket currently? CC-BY-SA is incompatible with the LGPL, although I don't think that's a problem in this case, s

Re: [racket] Ceylon language borrows Typed Racket features?

2011-11-15 Thread Sam Tobin-Hochstadt
On Monday, November 14, 2011, Luke Vilnis wrote: > Has anyone taken a look at the upcoming language > Ceylon? > It feels to me like a pretty aggressively blub-y Java clone, but it has two > features that seem like they're ripped straight out o

Re: [racket] Want to pretty print transparent values in hashes with key/value pairs

2011-11-16 Thread Sam Tobin-Hochstadt
This might help: > (struct P (x) #:transparent) > (pretty-print (hash 1 (P 2))) (hash 1 (P 2)) > (pretty-write (hash 1 (P 2))) #hash((1 . #(struct:P 2))) On Wed, Nov 16, 2011 at 11:06 AM, J. Ian Johnson wrote: >> (struct A (a)) >> (struct B (b) #:transparent) >> (pretty-print (make-hasheq (list

Re: [racket] Google Challenge

2011-11-23 Thread Sam Tobin-Hochstadt
Here's the overview and existing starter packages: http://aichallenge.org/starter_packages.php There's a faq that talks about it here: http://aichallenge.org/faq.php Here's the guide to creating starter packages: https://github.com/aichallenge/aichallenge/wiki/Ants-Starter-Pack-Guide On Wed, Nov 2

Re: [racket] typed racket Procedure is not a function type

2011-11-24 Thread Sam Tobin-Hochstadt
On Thu, Nov 24, 2011 at 11:22 AM, Ismael Figueroa Palet wrote: > I got the following error: "Type Checker: Cannot apply expression of type > Procedure, since it is not a function type" > > What is the rationale behind this? Probably the error message should be better here, but what's going on is

Re: [racket] Beginner can't get some Macintosh command keys to work

2011-11-24 Thread Sam Tobin-Hochstadt
On Thu, Nov 24, 2011 at 1:51 PM, Neil Toronto wrote: > For either of you, does turning on Caps Lock do it as well? DrRacket does > this weird thing on my Ubuntu box, where CTRL- inserts a > capitalized when Caps Lock is on, instead of invoking a shortcut. > > I haven't reported it yet because I t

Re: [racket] TR: unwrapping from <#Typed Value: ... > ??

2011-11-24 Thread Sam Tobin-Hochstadt
On Thu, Nov 24, 2011 at 3:14 PM, Ismael Figueroa Palet wrote: > I need to compare to procedures for equality. In the untyped version of the > code I used eq? and it worked for my purposes. > Now, in the Typed Racket version I'm having the problem that somehow one of > the procedures is wrapped in

Re: [racket] TR: unwrapping from <#Typed Value: ... > ??

2011-11-25 Thread Sam Tobin-Hochstadt
On Fri, Nov 25, 2011 at 8:28 AM, Ismael Figueroa Palet wrote: >> 2011/11/25 Sam Tobin-Hochstadt >> This means that you passed the procedure to an untyped module with the >> type `Any'.  If you provide a more specific type, it won't be wrapped >> like this. &g

Re: [racket] TR: unwrapping from <#Typed Value: ... > ??

2011-11-25 Thread Sam Tobin-Hochstadt
'll look into that. > On Fri, Nov 25, 2011 at 7:37 AM, Sam Tobin-Hochstadt > wrote: >> On Fri, Nov 25, 2011 at 8:28 AM, Ismael Figueroa Palet >> wrote: >>>> 2011/11/25 Sam Tobin-Hochstadt >>>> This means that you passed the procedure to an

Re: [racket] TR: unwrapping from <#Typed Value: ... > ??

2011-11-25 Thread Sam Tobin-Hochstadt
On Fri, Nov 25, 2011 at 10:30 AM, Robby Findler wrote: > On Fri, Nov 25, 2011 at 9:13 AM, Sam Tobin-Hochstadt > wrote: >> On Fri, Nov 25, 2011 at 9:58 AM, Robby Findler >> wrote: >>> Why can't you use contracts to do this kind of thing? >> >> Fir

Re: [racket] Disable/Enable Tests

2011-11-27 Thread Sam Tobin-Hochstadt
It doesn't appear to do anything at the moment -- it's only effect is to set a preference (buggily) which is only examined by the menu item, not by any testing code. I've been unable to determine when it stopped working via code archeology, but it was probably quite a while ago. On Sun, Nov 27, 20

Re: [racket] typed racket: equivalent to Any for function types?

2011-11-28 Thread Sam Tobin-Hochstadt
On Mon, Nov 28, 2011 at 10:35 AM, Ismael Figueroa Palet wrote: > As Any is supertype of all values, what is the equivalent type for function > types? > > (Any -> Any) does not work because of the contra-variant requirement of the > argument. > > (: f ((Any -> Any) -> True)) > (define (f g) #t) > >

Re: [racket] typed racket: equivalent to Any for function types?

2011-11-28 Thread Sam Tobin-Hochstadt
he case of `string-append'? Once you know what can happen then, it's easier to figure out the right solution. > 2011/11/28 Sam Tobin-Hochstadt >> >> On Mon, Nov 28, 2011 at 10:35 AM, Ismael Figueroa Palet >> wrote: >> > As Any is supertype of all values,

Re: [racket] Google Challenge

2011-11-29 Thread Sam Tobin-Hochstadt
le >> will be able to use Racket in the contest soon. >> >> For now, you can access my starter package here: >> >> https://github.com/stchang/aichallenge/tree/epsilon/ants/dist/starter_bots/racket >> >> >> >> >> >> On Wed, Nov 23, 2011

Re: [racket] parser-tools help

2011-11-30 Thread Sam Tobin-Hochstadt
To answer the most insignificant part of your email: On Wed, Nov 30, 2011 at 8:33 AM, Marijn wrote: > Finally, do racket's here-strings > support indented format like bash's here-strings do? No, but if you use the Scribble `at-exp' reader [1], it supports this: The Scribble syntax treats spac

Re: [racket] Typed Racket: problem with interaction between typed/untyped modules

2011-12-02 Thread Sam Tobin-Hochstadt
On Fri, Dec 2, 2011 at 5:38 PM, Ismael Figueroa Palet wrote: > > > I'm trying to implement a function wrapper, that given any function returns > a function of the same type, but that maybe applies a different argument. So > far I haven't been successful, and based on previous questions to the mail

Re: [racket] Typed Racket: problem with interaction between typed/untyped modules

2011-12-02 Thread Sam Tobin-Hochstadt
On Fri, Dec 2, 2011 at 6:26 PM, Ismael Figueroa Palet wrote: > Sam, first I want to thank you for all your answers, you've helped me a lot. > Thanks! > >> > I'm trying to implement a function wrapper, that given any function >> > returns >> > a function of the same type, but that maybe applies a d

Re: [racket] Typed Racket: problem with interaction between typed/untyped modules

2011-12-02 Thread Sam Tobin-Hochstadt
On Fri, Dec 2, 2011 at 6:57 PM, Ismael Figueroa Palet wrote: > > > 2011/12/2 Sam Tobin-Hochstadt >> >> On Fri, Dec 2, 2011 at 6:26 PM, Ismael Figueroa Palet >> wrote: >> > What I'm trying to do, so you get the full picture, is to write a >> > v

Re: [racket] Loops and performance

2011-12-03 Thread Sam Tobin-Hochstadt
On Sat, Dec 3, 2011 at 1:31 PM, Sergi Mansilla wrote: > > Anyway, my newbie question is: Is there a way to execute that code > faster? Perhaps I am in some debug mode, or I can pass parameters to > racket so it does some optimizations? I am just curious and just > kicking the tires of Racket. I am

Re: [racket] shortest paths, resource allocation/scheduling

2011-12-05 Thread Sam Tobin-Hochstadt
On Mon, Dec 5, 2011 at 10:00 AM, Geoffrey S. Knauth wrote: > I'm wondering if there is something in the now very rich set of Racket > libraries that already does this.  Let's say I have 5 points {A,B,C,D,E}.  I > want to interconnect all of them: > > {AB,AC,AD,AE,AF,BC,BD,BE,BF,CD,CE,CF,DE,DF,EF

Re: [racket] typed-racket now supports match?

2011-12-09 Thread Sam Tobin-Hochstadt
On Fri, Dec 9, 2011 at 3:04 PM, John Clements wrote: > Hey! When did this happen? It looks like typed/racket now supports match? Sorry to break it to you, but this has been the case for the entire existence of Typed Racket. :) -- sam th sa...@ccs.neu.edu

Re: [racket] Typed Racket error (exporting a struct containing a hash table)

2011-12-10 Thread Sam Tobin-Hochstadt
On Sat, Dec 10, 2011 at 5:54 PM, Jeremiah Willcock wrote: > When I run the following program: > > #lang typed/racket > (struct: A ((f : (HashTable Any Any > (provide (all-defined-out)) > > I get the error message: > > racket-Linux-install/lib/racket/collects/racket/contract/private/hash.rkt:57

Re: [racket] Typed Racket error (exporting a struct containing a hash table)

2011-12-10 Thread Sam Tobin-Hochstadt
On Sat, Dec 10, 2011 at 7:35 PM, Jeremiah Willcock wrote: > On Sat, 10 Dec 2011, Sam Tobin-Hochstadt wrote: > >> On Sat, Dec 10, 2011 at 5:54 PM, Jeremiah Willcock >> wrote: >>> >>> When I run the following program: >>> >>> #lan

Re: [racket] match-let

2011-12-11 Thread Sam Tobin-Hochstadt
On Sun, Dec 11, 2011 at 3:39 PM, Harry Spier wrote: > In the Racket Reference it gives this example for match-let . > > match-let ([(list a b) '(1 2)] >              [(vector x ...) #(1 2 3 4)]) >    (list b a x)) > > > '(2 1 (1 2 3 4)) > > I'm not clear why the result isn't '(2 1 #(1 2 3 4)) `x

Re: [racket] typed/racket request for type for 'fourth'

2011-12-13 Thread Sam Tobin-Hochstadt
On Tue, Dec 13, 2011 at 2:28 PM, John Clements wrote: > Currently, in typed/racket, if I have a value of type  (List Number Number > Symbol String), and I apply 'fourth' to it, I get (U Number Symbol String) > rather than String.[*] > > It looks to me like this is a "didn't get around to it yet"

Re: [racket] typed/racket request for type for 'fourth' [and 1 more messages]

2011-12-13 Thread Sam Tobin-Hochstadt
On Tue, Dec 13, 2011 at 2:47 PM, Eli Barzilay wrote: > 10 minutes ago, John Clements wrote: >> I know that there are some differences between the 'fourth' family >> and the 'cadddr' family w.r.t. the kinds of arguments that they >> accept, but it seems to me that if I have a (List Number Number >>

Re: [racket] Pull some rackunit tests into Scribble doc as examples?

2011-12-15 Thread Sam Tobin-Hochstadt
On Thu, Dec 15, 2011 at 7:54 AM, Greg Hendershott wrote: > > Ideally it would be something like @examples/test-case[ > ], which strips off the check-* parts, and uses that > as an expression for a normal Scribble example? The following (totally untested, written in my email buffer) seems like th

Re: [racket] Multiple return values

2011-12-15 Thread Sam Tobin-Hochstadt
On Thu, Dec 15, 2011 at 5:32 PM, Neil Toronto wrote: > On 12/15/2011 05:03 AM, Markku Rontu wrote: >> >> Named return values, ah the dream of symmetry. > > I think my mad-scientist advisor did something like this once. I think it > would be awesome to have this, and of course keyword arguments, as

Re: [racket] Racket documentation for web development is just awful!

2011-12-17 Thread Sam Tobin-Hochstadt
First, I want to encourage you to take a look at the "Continue" tutorial: http://docs.racket-lang.org/continue/ . It provides an excellent introduction for people new to the Racket web server. Second, one of the great things about Jay is that in addition to the video game talent and popped collars

Re: [racket] Racket documentation for web development is just awful!

2011-12-17 Thread Sam Tobin-Hochstadt
Would it be possible for programmer to provide a name generator, so that you could have pretty urls of the form: foo.com/session/175 You'd have to ensure in the web server that there weren't conflicts with the names currently being managed, but it seems plausible. On Sat, Dec 17, 2011 at 3:12 PM

Re: [racket] evaluate some code in the REPL of the running program

2011-12-19 Thread Sam Tobin-Hochstadt
DrRacket doesn't have a built-in keybinding for this, but thanks to its extensibility features, you can build it yourself. It's worked out as an example here: http://docs.racket-lang.org/drracket/Keyboard_Shortcuts.html?q=keybinding#%28part._.Sending_.Program_.Fragments_to_the_.R.E.P.L%29 On Mon,

Re: [racket] extracting "docstrings" from documentation

2011-12-19 Thread Sam Tobin-Hochstadt
On Mon, Dec 19, 2011 at 3:37 PM, Robby Findler wrote: > What is the usecase for this information? Giving people quick access > to docs in the REPL? I would personally want it for tooltips etc in DrRacket, and also when autocompleting identifiers. This is present in lots of existing IDEs such as

Re: [racket] racketcon podcasts & proceedings?

2011-12-19 Thread Sam Tobin-Hochstadt
Hi All, We apologize for the delay, and while we won't have the videos up in time to be delivered to your stocking by Santa, we hope to have the first of them up around the new year. > On Mon, Dec 19, 2011 at 11:13 AM, Eric Tanter wrote: >> Dear Santa Claus, >> >> This year I've been a good boy.

Re: [racket] TR: can I type-check an in-range at (Sequenceof Byte)?

2011-12-19 Thread Sam Tobin-Hochstadt
On Mon, Dec 19, 2011 at 6:02 PM, John Clements wrote: > This program > > #lang typed/racket > > (: seq (Sequenceof Byte)) > > (define seq (in-range 127)) > > ...yields this error: > > Type Checker: Expected (Sequenceof Byte), but got (Sequenceof > Nonnegative-Fixnum) in: (define seq (in-range 127

Re: [racket] TR: predicate for a Float ?

2012-01-05 Thread Sam Tobin-Hochstadt
On Fri, Jan 6, 2012 at 1:00 AM, John Clements wrote: > > Examining the difference between Inexact-Real and Float yields this: > >> (:type Float) > (U Float-Positive-Zero Float-Negative-Zero Float-Nan Positive-Float > Negative-Float) >> (:type Inexact-Real) > (U Float-Positive-Zero Float-Negative-

Re: [racket] TR: scope of universally quantified type variables is ... very strange?

2012-01-05 Thread Sam Tobin-Hochstadt
On Thu, Jan 5, 2012 at 11:56 PM, John Clements wrote: > I wrote a piece of code like this without thinking: > > #lang typed/racket > > (: f (All (T) (Number -> T -> T))) > (define ((f x) y) >  (ann y T)) > > ... and then, after a second, was sort of flabbergasted that it worked.   > What's the sco

Re: [racket] TR: scope of universally quantified type variables is ... very strange?

2012-01-06 Thread Sam Tobin-Hochstadt
On Jan 7, 2012 2:24 AM, "John Clements" wrote: > > > On Jan 5, 2012, at 5:32 PM, Sam Tobin-Hochstadt wrote: > > > On Thu, Jan 5, 2012 at 11:56 PM, John Clements > > wrote: > >> I wrote a piece of code like this without thinking: > >> > >

Re: [racket] clarification for a Typed Racket error?

2012-01-07 Thread Sam Tobin-Hochstadt
This is clearly a bug -- the code ought to typecheck just fine. I'll take a look at it. On Fri, Jan 6, 2012 at 2:24 AM, Erik Silkensen wrote: > Hi, > > I was wondering if someone could help me understand the problem with the > following code? > > (struct: obj ([a : Integer] [b : Symbol])) > > (

Re: [racket] drivers wanted (Was: string-strip)

2012-01-11 Thread Sam Tobin-Hochstadt
On Wed, Jan 11, 2012 at 10:56 AM, Matthias Felleisen wrote: > > On Jan 11, 2012, at 10:25 AM, Neil Van Dyke wrote: > >> I'm sure that Matthew could speak to some of the finer points of I/O ports, >> but I think that string port performance is one of those things that some >> bright and motivated

Re: [racket] drivers wanted (Was: string-strip)

2012-01-11 Thread Sam Tobin-Hochstadt
On Wed, Jan 11, 2012 at 11:15 AM, Norman Gray wrote: > > On 2012 Jan 11, at 16:03, Sam Tobin-Hochstadt wrote: > >> The list is here: https://github.com/plt/racket/wiki/Intro-Projects . >> Feel free to add to it -- it's a wiki.  Currently, it focuses on >> proj

Re: [racket] filtering syntax

2012-01-13 Thread Sam Tobin-Hochstadt
On Fri, Jan 13, 2012 at 9:23 AM, Matthias Felleisen wrote: > compute the free variables with a simple recursive pass over core syntax, Note that there's code to do this here: http://pre.racket-lang.org/docs/html/syntax/syntax-helpers.html -- sam th sa...@ccs.neu.edu Racke

Re: [racket] filtering syntax

2012-01-16 Thread Sam Tobin-Hochstadt
On Mon, Jan 16, 2012 at 7:57 AM, Marijn wrote: > >    ((_ ((id rule) ...)) >     (with-syntax (((dep ...) (free-vars (expand #'(rule ...) You need to use `local-expand', not `expand', here. Probably like this: (local-expand #'(rule ...) 'expression '()) -- sam th sa...@ccs.neu.edu

Re: [racket] filtering syntax

2012-01-17 Thread Sam Tobin-Hochstadt
On Tue, Jan 17, 2012 at 4:06 AM, Marijn wrote: > On 16-01-12 15:28, Sam Tobin-Hochstadt wrote: >> On Mon, Jan 16, 2012 at 7:57 AM, Marijn wrote: >>> >>> ((_ ((id rule) ...)) (with-syntax (((dep ...) (free-vars (expand >>> #'(rule ...) >> >&g

Re: [racket] HtDP recommended approach for reuse in HtDP?

2012-01-27 Thread Sam Tobin-Hochstadt
On Fri, Jan 27, 2012 at 2:10 PM, Grant Rettke wrote: > > I also ran into this: > > http://stackoverflow.com/questions/8996394/including-files-from-within-racket-scheme > > Is there an officially recommended way? Or is that it? The answer Ryan gives about `require` seems exactly right. -- sam th

Re: [racket] corrupted filenames command-line error messages

2012-01-28 Thread Sam Tobin-Hochstadt
On Sat, Jan 28, 2012 at 10:44 AM, Neil Van Dyke wrote: > Er, I suppose that the entirety of "procedure ...oice-style-3.rkt:169:27" is > the inferred procedure name, and that the syntax's filename&line&column > location info was lost. I don't think anything is being lost here. Line 169 appears to

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

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

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 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: >>&

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 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: >>

Re: [racket] Extract values from `time` function

2012-02-05 Thread Sam Tobin-Hochstadt
You want to use the `time-apply' function. The documentation is here: http://docs.racket-lang.org/reference/time.html?q=time-apply#%28def._%28%28quote._~23~25kernel%29._time-apply%29%29 In general, (time e) can be converted to (time-apply (lambda () e) '()), which produces values instead of print

Re: [racket] racket in the cloud

2012-02-07 Thread Sam Tobin-Hochstadt
There are many things that might be meant by "the cloud", but on the simplest interpretation, the answer is definitely yes. For example, Eric Hanchrow (offby1) run the irc bot "rudybot" [1] from an Amazon EC2 Linux image. There are also two Racket bindings to the AWS service api, in various state

Re: [racket] Why no string function to replace substring based on content in Racket

2012-02-07 Thread Sam Tobin-Hochstadt
On Tue, Feb 7, 2012 at 8:05 PM, Harry Spier wrote: > > I'd like to convert these programs to Racket, but using regular > expressions might be too slow. I find that my intuitions about what might or might not be too slow are usually wrong. Have you tried measuring this? -- sam th sa...@ccs.neu.e

[racket] Call for Papers: Workshop on Script to Program Evolution (STOP 2012)

2012-02-18 Thread Sam Tobin-Hochstadt
Chaudhuri, Adobe Labs   Kathryn Gray, Swansea University   Arjun Guha, Brown University   David Herman, Mozilla Research   Manuel Hermenegildo, IMDEA   Atsushi Igarashi, Kyoto University   Ranjit Jhala, University of California, San Diego   Sam Tobin-Hochstadt (Chair), Northeastern University

Re: [racket] for/vector bug in typed racket

2012-02-19 Thread Sam Tobin-Hochstadt
On Sun, Feb 19, 2012 at 1:13 PM, SF wrote: > > ; this doesn't > (for/vector: : (Vectorof Integer) >  ([i 5]) >  i) Unfortunately, Typed Racket does not yet do enough inference to figure out uses of `for/vector' in all cases, so you will probably need to write the loop explicitly here. -- sam th

Re: [racket] Multi-return Function Call

2012-02-21 Thread Sam Tobin-Hochstadt
That seems very surprising, since the journal paper (JFP 2006) about MRLC talks a lot about implementation strategies, and includes performance measurements for a compiler that implements MRLC. I think Anthony's implementation resembles the implementation in terms of exceptions discussed in sectio

Re: [racket] TR disappearing types?

2012-02-22 Thread Sam Tobin-Hochstadt
On Wed, Feb 22, 2012 at 3:51 PM, Neil Toronto wrote: > The following program types without trouble: > > > #lang typed/racket > > (struct: (a) Foo ()) > > (: make-foo (All (a) (a -> (Foo a > (define (make-foo x) >  (Foo)) > > (ann (make-foo 1) : (Foo String)) > > It doesn't seem like it should,

Re: [racket] TR: Making recursive types as subtypes of non-recursive types

2012-02-22 Thread Sam Tobin-Hochstadt
You're very close -- you just need to give inference a little more help. This definition works: (: card* (All (a) ((Set* a) -> Hereditary-Set))) (define (card* A) ((inst card (U a (Set* a))) A)) My brain was injured thinking about those types, though. :) On Wed, Feb 22, 2012 at 7:11 PM, Neil

Re: [racket] TR: Making recursive types as subtypes of non-recursive types

2012-02-23 Thread Sam Tobin-Hochstadt
On Thu, Feb 23, 2012 at 1:30 PM, Neil Toronto wrote: > On 02/22/2012 05:35 PM, Sam Tobin-Hochstadt wrote: >> >> You're very close -- you just need to give inference a little more >> help.  This definition works: >> >> (: card* (All (a) ((Set* a) -&g

Re: [racket] Missing turtle

2012-02-26 Thread Sam Tobin-Hochstadt
On Sun, Feb 26, 2012 at 5:00 PM, Robby Findler wrote: > On Sun, Feb 26, 2012 at 2:33 PM, Jens Axel Søgaard > wrote: >> I have sent a bugfix to github. > > Thanks! > > Sorry if I'm being dense here, but how do I get a hold of that? (For future reference) You can see "pull requests" on github here

Re: [racket] Macro Help

2012-02-26 Thread Sam Tobin-Hochstadt
On Sun, Feb 26, 2012 at 8:39 PM, Neil Van Dyke wrote: > I suggest forgetting about "syntax-rules", and using Ryan Culpepper's > "syntax-parse" instead. Here's a version using `syntax-parse': (require (for-syntax syntax/parse)) (define-syntax (function stx) (syntax-parse stx #:literals (->)

Re: [racket] Scribblings @defproc for typed/racket

2012-02-27 Thread Sam Tobin-Hochstadt
On Mon, Feb 27, 2012 at 12:33 PM, Ray Racine wrote: > > I have a bunch of typed/racket code that I'm trying to document with > visions of planet as an end state. > > Is there away to use scribble to document procedures in a more > typed/racket fashion? I would use the standard `defproc' syntax, b

Re: [racket] Scribblings @defproc for typed/racket

2012-02-27 Thread Sam Tobin-Hochstadt
On Mon, Feb 27, 2012 at 2:25 PM, Ray Racine wrote: > In the vein of scribblings for various typed/racket idioms. > > How would you scribble a define-type. > e.g. > > (define-type AttributeReq (U 'All 'SenderId 'SentTimestamp > 'ApproximateReceiveCount 'ApproximateFirstReceiveTimestamp)) Something

Re: [racket] Scribblings @defproc for typed/racket

2012-02-28 Thread Sam Tobin-Hochstadt
> @defthing works ok aswll. >> >> @defthing[AttributeName (U 'All 'SenderId 'SentTimestamp >>                            'ApproximateReceiveCount >>    'ApproximateFirstReceiveTimestamp)]{ >> A define-type of an enumeration of allowable code value

Re: [racket] Debug button unavailable when is should not be

2012-03-01 Thread Sam Tobin-Hochstadt
On Thu, Mar 1, 2012 at 3:22 AM, Dmitry Pavlov wrote: > > I once implemented a DSL called "slon" in Racket. > My programs start with "#lang slon", and I open > them in DrRacket, edit, run, and debug them. > > To make Racket aware of the DSL, I can either put a symbolic > link to my code into the st

Re: [racket] phases

2012-03-01 Thread Sam Tobin-Hochstadt
http://www.ccs.neu.edu/scheme/pubs/scheme2007-ctf.pdf On Thu, Mar 1, 2012 at 4:19 PM, Jon Rafkind wrote: > link > > On 03/01/2012 01:53 PM, Sam Tobin-Hochstadt wrote: >> There's also something of a tutorial on phases in our Scheme Workshop >> 2007 paper, some of which

Re: [racket] phases

2012-03-01 Thread Sam Tobin-Hochstadt
There's also something of a tutorial on phases in our Scheme Workshop 2007 paper, some of which might be worth adding here. In particular, it has some pictures/diagrams. On Thu, Mar 1, 2012 at 3:52 PM, Matthias Felleisen wrote: > > Nice job. Now polish and add this write-up to the guide. Thanks

Re: [racket] phases

2012-03-02 Thread Sam Tobin-Hochstadt
On Fri, Mar 2, 2012 at 4:47 AM, Marijn wrote: > One other thing > that could use some explanation is why racket uses phases in the first > place, given that other systems (I believe Larceny is the prime > example) have implemented a phase-less or phase-inferring macro system. The short answer for

Re: [racket] Type-class-like idiom in Racket?

2012-03-05 Thread Sam Tobin-Hochstadt
On Mon, Mar 5, 2012 at 8:18 AM, Matthias Felleisen wrote: > > On Mar 4, 2012, at 11:36 PM, Helmut Rohrbacher wrote: > >> Danny & Matthias, >> >> I hadn't known about structure properties. I think lumping enough syntactic >> sugar onto your syntax definitions, Matthais, might make it feasible to

Re: [racket] eginner's question on elementary textual replacement...

2012-03-09 Thread Sam Tobin-Hochstadt
On Fri, Mar 9, 2012 at 5:59 AM, Thomas Chust wrote: > Anyway, if one worries about the performance cost of constants inlined > at compile time versus constants inlined by the JIT, then using a > language as high-level as Racket may be a mistake. Not really related to the rest of this discussion,

Re: [racket] Scala Macros Beta

2012-03-09 Thread Sam Tobin-Hochstadt
On Fri, Mar 9, 2012 at 2:43 PM, Asumu Takikawa wrote: > Hi all, > > Previously on this list I mentioned that the Scala developers are > designing a macro system. Today I heard from one of the developers that > they now have a beta version of their proposal out and that they are > looking forward t

Re: [racket] Any way to get "true" quasiquote behavior in match form?

2012-03-09 Thread Sam Tobin-Hochstadt
On Fri, Mar 9, 2012 at 7:44 PM, Robby Findler wrote: > You can write > > (match l1 >  [`(1 2 ,(? (lambda (x) (equal? x a #t] >  [_ #f]) The following also means the same as what Robby wrote: (match l1  [`(1 2 ,(== a)) #t]  [_ #f]) -- sam th sa...@ccs.neu.edu Rac

Re: [racket] Typed Racket - Parameterized Structures

2012-03-14 Thread Sam Tobin-Hochstadt
2012/3/14 Ray Racine : > I could use an assist on getting the following to type check. The program below works. I made two changes. 1. You added `All' in the type parameter list for `struct:'. You don't need that there, and instead it was adding a third type parameter to `Cvt'. 2. There's some

Re: [racket] Typed Racket - Parameterized Structures

2012-03-14 Thread Sam Tobin-Hochstadt
On Wed, Mar 14, 2012 at 10:27 AM, Matthias Felleisen wrote: > > On Mar 14, 2012, at 8:28 AM, Sam Tobin-Hochstadt wrote: > >> 1. You added `All' in the type parameter list for `struct:'.  You >> don't need that there, and instead it was adding a third type &g

Re: [racket] Typed Racket - Parameterized Structures

2012-03-14 Thread Sam Tobin-Hochstadt
ences (even mine). > Is (All (All) (All -> All)) a type? No, that doesn't parse, so there's clearly an inconsistency here. I will have to think about the best way to resolve it. > On Mar 14, 2012, at 10:55 AM, Sam Tobin-Hochstadt wrote: > >> On Wed, Mar 14, 2012 at 10:27

Re: [racket] Racket DB library

2012-03-15 Thread Sam Tobin-Hochstadt
On Thu, Mar 15, 2012 at 8:03 AM, Neil Van Dyke wrote: > gonzalo diethelm wrote at 03/15/2012 07:46 AM: > >> How can I get my hands on just that part of the docs as a PDF? >> > > > Google says: http://pre.plt-scheme.org/docs/pdf/db.pdf That's the nightly build version; the release version is here:

Re: [racket] request for test for IE7 deprecation warning for WeScheme

2012-03-26 Thread Sam Tobin-Hochstadt
On Mon, Mar 26, 2012 at 4:26 PM, Danny Yoo wrote: > > #< WeScheme detects that you are using IE 6/7. Note that WeScheme will no > longer support Internet Explorer 7 after June 1st, 2012. Please update > your browser to a newer version. These browsers include Chrome, > Firefox, or Safari. > EOF Al

[racket] Third Call for Papers: Workshop on Script to Program Evolution (STOP 2012)

2012-03-27 Thread Sam Tobin-Hochstadt
CALL FOR PAPERS 3rd Workshop on Script to Program Evolution (co-located with ECOOP and PLDI) Beijing, China June 11, 2012 http://wrigstad.com/stop12/ Submission site: http://continue2.cs.brown.edu/stop2012/ OVERVIEW Recent years have seen increased use of scripting languages in large applic

Re: [racket] release date for RacketCon videos?

2012-04-04 Thread Sam Tobin-Hochstadt
advocacy and publicity. If you know of any other "missed opportunities" where Racket could be better promoted, please let me know, or just mention it on this list. Best, Sam Tobin-Hochstadt Racket Users list: http://lists.racket-lang.org/users

<    1   2   3   4   5   6   7   8   9   10   >