Re: [racket] iPhone

2010-06-18 Thread John Clements
ior approval. My guess is that when this becomes feasible, it will happen. John Clements smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Web Application Deployment

2010-06-25 Thread John Clements
On Jun 23, 2010, at 7:33 AM, Ken Struys wrote: > Oops forgot the link: http://pandela.com/ FWIW dep't.: Linode ($20/month) sounds better than this (16 GB, 512 MB ram, etc.). John Clements smime.p7s Description: S/MIME cryptographic s

Re: [racket] Loop in Racket

2010-06-27 Thread John Clements
On Jun 27, 2010, at 6:32 PM, Brad Long wrote: > Dear racketeers, > > What is the reason for not offering a looping construct in racket? For > example, something like: > > (loop (i 1 10) (print i)) > It's there: (for/list ([i (in-range 1 10)]) i) prints out '(1 2 3 4 5 6 7 8 9) ... also

[racket] difference between serve/servlet and serve/dispatch?

2010-06-29 Thread John Clements
I'm puzzled by this function: (serve/dispatch dispatch) → void dispatch : (request? . -> . response/c) Calls serve/servlet with appropriate arguments so that every request is handled by dispatch. Specifically, it appears that serve/dispatch has the same contract (minus all the optional args)

Re: [racket] difference between serve/servlet and serve/dispatch?

2010-06-29 Thread John Clements
On Jun 29, 2010, at 11:39 AM, Jay McCarthy wrote: > serve/dispatch sets up the servlet-regexp argument of serve/servlet so > that all URLs go to the dispatch function. Perhaps I could change the docs to read: Calls serve/servlet with a 'servlet-regexp' argument so that every request is handled

Re: [racket] All black images...Ahhh

2010-07-20 Thread John Clements
g130.imageshack.us/img130/7563/76349361.jpg First: I'm certainly impressed by the detail of your graphics. Second: It looks to me like this is an alpha channel issue; specifically, it looks like the transparency is being handled correctly, but that the pixel color info is lost. Can yo

Re: [racket] Neophyte Alert

2011-08-31 Thread John Clements
> -- When is it appropriate to use RackUnit, and when should Contracts be used > instead? :) > > P.S. Has anyone given any thought to consolidating some of the Racket > discussion to a StackExchange site? Or something else of that i

[racket] Racket Badges

2011-08-31 Thread John Clements
I wish you could earn Racket badges and levels for completing exercises, getting +1'ed on the mailing list, and contributing code and documentation. Just thinking out loud, I'm afraid. John smime.p7s Description: S/MIME cryptographic signature _

[racket] Running code on exit....

2011-09-01 Thread John Clements
I'd love to find a way to call a sound library's "terminate" function when Racket shuts down. My recollection of the lay of the land here is that it's very hard to make this happen correctly without mangling Racket itself. At a high level, I believe the explanation is that it violates the bound

Re: [racket] Running code on exit....

2011-09-01 Thread John Clements
On Sep 1, 2011, at 8:03 PM, Eli Barzilay wrote: > Two hours ago, Robby Findler wrote: >> Does it make sense to have the resource managed by a custodian? That >> is, operate the ffi/C level where you can extend what happens when a >> custodian is shutdown to close whatever needs closing or finaliz

Re: [racket] need to control PLaneT versions

2011-09-01 Thread John Clements
On Aug 23, 2011, at 10:15 AM, Neil Van Dyke wrote: > PLaneT issue I've mentioned this in the past, and it just bit me again... > > For production systems that use PLaneT packages, we need a way for an > application programmer to control the versions of *all* PLaneT packages -- > including the

Re: [racket] Installing

2011-09-02 Thread John Clements
r (where you downloaded it) and press enter. > - Follow the instructions. Also keep in mind that if you want to install it in a public location, you'll need to have the right privileges. This often involves running the installer as root, e.g.: sudo sh John Clements > > Vinc

Re: [racket] recent updates to Whalesong development: web-world

2011-09-05 Thread John Clements
On Sep 5, 2011, at 12:51 PM, Danny Yoo wrote: > I got some good feedback, and made some changes! > > > The code that's generating should behave under Firefox now. Please > try this again: > >http://hashcollision.org/whalesong/examples/todo/todo.html Appears to work for me, 64-bit OS X 10

Re: [racket] online check syntax error display tweak

2011-09-08 Thread John Clements
On Sep 8, 2011, at 8:48 PM, Robby Findler wrote: > I've changed how online check syntax reports errors. Instead of > hilighting the source location in gold, it puts a little reddish thing > in the right-hand margin where the error is. The goal is to make this > less obtrusive in, say, lecture, bu

Re: [racket] online check syntax error display tweak

2011-09-09 Thread John Clements
On Sep 9, 2011, at 9:20 AM, Robby Findler wrote: > On Fri, Sep 9, 2011 at 11:05 AM, Vincent St-Amour > wrote: >> At Fri, 9 Sep 2011 10:58:23 -0500, >> Robby Findler wrote: >>> I thought about that, but I didn't want it to overlap the text and I >>> didn't want it to slide everything over to mak

[racket] can custodian-shutdown-all interrupt an #:atomic callback?

2011-09-09 Thread John Clements
It looks to me as though when a custodian-shutdown-all occurs, the custodian actions associated using scheme_add_managed() can be triggered while another thread is in the middle of a callback to an FFI-generated callback that includes the #:atomic declaration. Is this true? If true, is it only

Re: [racket] can custodian-shutdown-all interrupt an #:atomic callback?

2011-09-10 Thread John Clements
On Sep 9, 2011, at 5:59 PM, Matthew Flatt wrote: > At Fri, 9 Sep 2011 17:39:38 -0700, John Clements wrote: >> It looks to me as though when a custodian-shutdown-all occurs, the >> custodian actions associated using scheme_add_managed() can be >> triggered while another threa

Re: [racket] can custodian-shutdown-all interrupt an #:atomic callback?

2011-09-10 Thread John Clements
On Sep 10, 2011, at 12:44 PM, Matthew Flatt wrote: > At Sat, 10 Sep 2011 12:00:19 -0700, John Clements wrote: >> >> >> However, looking more carefully at the stack trace below, I think I've >> misread >> it. >> >> This dump came from a

Re: [racket] Too Many Redirects (Apache)

2011-09-16 Thread John Clements
On Sep 16, 2011, at 6:59 AM, Jeremy Kun wrote: > Oops, meant to reply-all > > Jeremy One other relevant thought; how hard would it be to throw out Apache and just use setuid to demote racket's privileges after starting? I don't see a built-in binding for setuid--presumably because it's comple

Re: [racket] Too Many Redirects (Apache)

2011-09-16 Thread John Clements
Jay > > On Fri, Sep 16, 2011 at 11:31 AM, John Clements > wrote: >> >> On Sep 16, 2011, at 6:59 AM, Jeremy Kun wrote: >> >>> Oops, meant to reply-all >>> >>> Jeremy >> >> One other relevant thought; how hard would it be to thro

Re: [racket] Too Many Redirects (Apache)

2011-09-16 Thread John Clements
On Sep 16, 2011, at 11:03 AM, Jay McCarthy wrote: > I think you can use ffi-lib with #f because it is already attached. Yeah, okay, looks like this works: #lang racket (require ffi/unsafe) ;; return type is "gid_t". Safe to use int? (define setuid (get-ffi-obj "setuid" (ffi-lib #f)

Re: [racket] Quoted expressions in #lang racket

2011-09-18 Thread John Clements
On Sep 18, 2011, at 9:12 AM, Racket Noob wrote: > Saying that (quote (1 2 3)) evaluates to (quote (1 2 3)) [instead to (1 2 3)] > is the same nonsanse to me like saying that (+ 1 2) evaluates to (+ 1 2) > [instead to 3]. Be careful with words like "nonsense" :). What does 3 evaluate to? 3

Re: [racket] Quoted expressions in #lang racket

2011-09-18 Thread John Clements
On Sep 18, 2011, at 2:01 PM, Racket Noob wrote: > Such a cold community. :( Cold? No way! We're *hot*. That is: we're eager to discuss, and eager to argue. If anything, we're holding back, to avoid making you angry. Maybe we should have held back a bit more? I know it can feel a bit lonely w

Re: [racket] Offtopic: Learning SML

2011-09-18 Thread John Clements
On Sep 18, 2011, at 10:36 AM, Grant Rettke wrote: > Hi, > > Over the years I've noticed on-list that comments are made about OCaml > and Haskell and abstract data types. > > It seems like it would be fun to learn more about this stuff; and I > guessed that learning SML would be a nice place to

Re: [racket] plai test/exn

2011-09-19 Thread John Clements
On Sep 19, 2011, at 1:47 PM, Jeremy Kun wrote: > Not sure if this is a bug, but it doesn't match the documentation here. It > says test/exn only succeeds when the error is explicitly raised by the user, > but I try something as simple as: > > "file1.rkt" > (provide foo) > (define (foo) (error

Re: [racket] plai test/exn

2011-09-19 Thread John Clements
> -Eric > > On Mon, Sep 19, 2011 at 2:49 PM, John Clements > wrote: >> >> On Sep 19, 2011, at 1:47 PM, Jeremy Kun wrote: >> >>> Not sure if this is a bug, but it doesn't match the documentation here. It >>> says test/exn only succeeds when

Re: [racket] Writing parallel racket benchmarks

2011-09-26 Thread John Clements
On Sep 25, 2011, at 6:21 PM, Sam Tobin-Hochstadt wrote: > This past week, I wrote some parallel Racket versions of benchmarks > for the Computer Language Shootout. It was fun to do, and I wrote a > little bit about what I learned: > http://scriptstoprograms.wordpress.com/2011/09/25/benchmarketin

Re: [racket] making flvector with C API?

2011-09-29 Thread John Clements
small Racket wrapper around the C function that creates the flvector? This would probably save you 5-10 lines of C and several opportunities for a core dump, as well. :) John Clements smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Poll: Does anybody besides Doug use 'plot'?

2011-09-30 Thread John Clements
On Sep 30, 2011, at 8:34 AM, Neil Toronto wrote: > At Eli's suggestion, I'm conducting a poll. Does anybody on this list use the > 'plot' module, or know of someone who does? > > (I'm specifically excluding Doug Williams and his williams/science PLaneT > package because I already know about th

[racket] Racket Apology (was: Re: Poll: Does anybody besides Doug use 'plot'?)

2011-09-30 Thread John Clements
On Sep 30, 2011, at 10:05 AM, Robby Findler wrote: > On Fri, Sep 30, 2011 at 12:01 PM, John Clements > wrote: >> In my world, a change will fall into the "yes, racket is a rapidly changing >> language" bin; >> it's not unusual for much of my old code

Re: [racket] Concurrent execution

2011-10-06 Thread John Clements
On Oct 6, 2011, at 4:48 AM, Robby Findler wrote: > Do you want async-channel, maybe? If not, then rolling your own > syncronization pattern via the CML-like primitives is the way to go. > Once you get used to programming with them, they are very easy to use > and easy to make thread-safe things (

Re: [racket] Sounds in Universe?

2011-10-19 Thread John Clements
On Oct 19, 2011, at 6:30 AM, Shriram Krishnamurthi wrote: > John, have you run your audio stuff w/ world? How hard would that be? Not hard. In particular, I've isolated the low-level ffi connection in the "portaudio" planet package, which includes a "push" and a "pull" interface. Eli suggeste

Re: [racket] Saving and restoring many parameters

2011-10-19 Thread John Clements
On Oct 19, 2011, at 9:29 AM, John Clements wrote: > > On Oct 19, 2011, at 4:03 AM, Robby Findler wrote: > >> (I'm sorry if you got this message already; I thought I sent it >> already but I don't see it.) >> >> What about the current-output/erro

Re: [racket] Saving and restoring many parameters

2011-10-19 Thread John Clements
On Oct 19, 2011, at 4:03 AM, Robby Findler wrote: > (I'm sorry if you got this message already; I thought I sent it > already but I don't see it.) > > What about the current-output/error-port? what about the > current-namespace? current-custodian? > > There are lots of parameters that affect co

Re: [racket] sound + universe report: success

2011-10-19 Thread John Clements
On Oct 19, 2011, at 10:26 PM, Paul A. Steckler wrote: > On Thu, Oct 20, 2011 at 4:21 PM, wrote: >> 1. sound + universe report: success. (John Clements) > > How are you processing the sounds? > > It so happens I will be seeing the author of libsndfile this evening. >

Re: [racket] sound + universe report: success.

2011-10-20 Thread John Clements
On Oct 20, 2011, at 3:53 AM, Stephen Bloch wrote: > > On Oct 20, 2011, at 1:20 AM, John Clements wrote: > >> I'm pleased to report that the sound library works pretty transparently with >> the universe teachpack. >> ... >> (define (accelerate

Re: [racket] sound + universe report: success.

2011-10-20 Thread John Clements
On Oct 20, 2011, at 4:59 AM, Matthias Felleisen wrote: > > I think you rather mean the difference between event handlers in Worlds and > event handlers for Universe Worlds: return a package that may include a sound > to be played. Sounds depend too much on the exact action you took. > > What

Re: [racket] sound + universe report: success.

2011-10-20 Thread John Clements
On Oct 20, 2011, at 11:42 AM, Matthias Felleisen wrote: > > On Oct 20, 2011, at 2:37 PM, John Clements wrote: > >> Are you saying that multiple sounds could be occurring at once? This is >> true, but doesn't strike me as a priori unpleasant. > > Yes. S

Re: [racket] sound + universe report: success.

2011-10-20 Thread John Clements
On Oct 20, 2011, at 6:47 AM, Viera Proulx wrote: > This is why I think that playing MIDI sounds is the correct model for the > world. > On tick we add to the world the sounds that are to be played - they stop > playing when the next tick starts. (Or, if we control the duration, we > include th

Re: [racket] sound + universe report: success.

2011-10-21 Thread John Clements
On Oct 20, 2011, at 3:34 PM, Jay McCarthy wrote: > FWIW, my sound system does all this. You know, jay, you have quite a good number of github trees :). Are you referring to one of them here? John smime.p7s Description: S/MIME cryptographic signature

Re: [racket] sound + universe report: success.

2011-10-21 Thread John Clements
On Oct 21, 2011, at 4:29 AM, Jay McCarthy wrote: > The one I linked the first time > > https://github.com/get-bonus/get-bonus/blob/master/exp/3s.rkt > > and an example of its use > > https://github.com/get-bonus/get-bonus/blob/master/games/tennis/tennis.rkt Sorry, missed that. It looks like

Re: [racket] sound + universe report: success.

2011-10-21 Thread John Clements
On Oct 21, 2011, at 1:56 PM, Jay McCarthy wrote: > Not really, but you could overlay one. OpenAL reads the sound from a > queue and sends you a signal when the queue is getting empty. You > could catch that and generate more. > > Or maybe I don't understand what you mean by pull Nope, that's it

Re: [racket] list of Racket <-> Scheme R5RS differences?

2011-10-25 Thread John Clements
On Oct 25, 2011, at 11:52 AM, Dan Grossman wrote: > Hi all, > > I'm wondering if there's a concise, informal, mostly complete list of > R5RSisms that won't work in Racket (#lang racket). As I'm porting > some old teaching materials to Racket, I've come across: > > * Cannot write (if e1 e2); re

Re: [racket] arity of + versus <=

2011-10-28 Thread John Clements
On Oct 28, 2011, at 8:12 AM, Joe Marshall wrote: > On Wed, Oct 26, 2011 at 8:32 PM, Dan Grossman wrote: >> Very minor point, but is there a rationale beyond historical precedent >> for + and * to allow any number of arguments but, =, <=, <, >, >= to >> require at least two arguments? > > 0 is t

[racket] running thirty copies of DrRacket from one user account?

2011-10-28 Thread John Clements
I've got a bunch of visitors coming in tomorrow for a DrRacket Music demo, and I'm hoping to have them all use the same account. My experience with this in the past suggests that there may have been some contention over prefs files; some machines became unresponsive, and I'm guessing this was th

[racket] Can places blocked on mzrt semaphores be killed with place-kill?

2011-11-03 Thread John Clements
I've just had a look through the docs, and I don't see an answer to this question. If I have a place that's blocked on an mzrt-semaphore (not a regular one, but a full-on-block-an-OS-thread semaphore), will (place-kill ...) successfully kill the place? John P.S.: Obligatory research: I'm thi

Re: [racket] match and debug in Advanced Student

2011-11-08 Thread John Clements
On Nov 8, 2011, at 8:17 PM, Prabhakar Ragde wrote: > I never use the Debug button, but I let my students start using Advanced > Student today, and of course they tried it out. > > The following program induces a strange error when the Debug button is > pressed. > > (match 3 > [`(,x) 3] > [x

[racket] round/square (was: Re: DrRacket needs work)

2011-11-14 Thread John Clements
On Nov 14, 2011, at 8:43 AM, Robby Findler wrote: > Yes, I believe the bug is in that interaction. Sorry I've not had a > chance to look into it yet. Let me stick my hand up here: I'm the one who added automatic parens. Yes, automatic parens don't work with square brackets. This is a symptom of

Re: [racket] DrRacket needs work

2011-11-14 Thread John Clements
On Nov 14, 2011, at 2:58 PM, Neil Van Dyke wrote: > Robby Findler wrote at 11/14/2011 05:45 PM: >> I've looked through iconfinder.com on more than one occasion for a >> reasonable check syntax icon, but not found one. Any specific >> suggestions? >> > > If no one can find a suitable icon off-

Re: [racket] editing racket code effectively

2011-11-15 Thread John Clements
On Nov 15, 2011, at 6:22 PM, Tom McNulty wrote: > Be sure to check out the following doc, there are lots of useful bindings for > efficient editing. > > http://docs.racket-lang.org/drracket/Keyboard_Shortcuts.html?q=keybindings > > For printf statements in particular: > >> C-c C-l : wraps a

Re: [racket] Why internal definitions?

2011-11-16 Thread John Clements
...])])) I sometimes wish that too... but looking at your mail, the second one is much easier to read and understand. John Clements smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Behaviour with read-only files

2011-11-17 Thread John Clements
On Nov 17, 2011, at 9:12 AM, Alexander Krimm wrote: > > PS: is there any way to stop the stepper from continuing to execute the > programm while you are looking at steps in the beginning of the > programm? I had an infinite loop in one of my programms and while i was > trying to figure out why b

Re: [racket] Behaviour with read-only files

2011-11-17 Thread John Clements
On Nov 17, 2011, at 10:10 AM, Matthias Felleisen wrote: > > On Nov 17, 2011, at 1:08 PM, John Clements wrote: > >> >> On Nov 17, 2011, at 9:12 AM, Alexander Krimm wrote: >> >>> >>> PS: is there any way to stop the stepper from continuing to exec

Re: [racket] Behaviour with read-only files

2011-11-17 Thread John Clements
On Nov 17, 2011, at 10:35 AM, Matthias Felleisen wrote: > > On Nov 17, 2011, at 1:13 PM, John Clements wrote: > >> Minor problem: the "end" button. > > Disable it until you have found the end or replace it with '1000 steps' > button > > &

Re: [racket] Behaviour with read-only files

2011-11-17 Thread John Clements
On Nov 17, 2011, at 10:53 AM, Matthias Felleisen wrote: > > On Nov 17, 2011, at 1:47 PM, John Clements wrote: > >> Suppose you run a big-bang program that puts a dot on the screen every time >> you press a key. Now suppose it runs for 1K steps and halts. The user sees

Re: [racket] Behaviour with read-only files

2011-11-17 Thread John Clements
e take this off racket-users? John > > Robby > > On Thu, Nov 17, 2011 at 12:56 PM, John Clements > wrote: >> >> On Nov 17, 2011, at 10:53 AM, Matthias Felleisen wrote: >> >>> >>> On Nov 17, 2011, at 1:47 PM, John Clements wrote: >>>

[racket] choosing channels or async-channels

2011-11-17 Thread John Clements
I always wrestle with whether to use channels or asynchronous channels; specifically, you can model non-blocking 'put' with channels by spawning a thread that calls 'channel-put'. Moreover, I have more warm fuzzies associated with regular channels, because they're part of the CML model. If I'

[racket] typed-racket now supports match?

2011-12-09 Thread John Clements
Hey! When did this happen? It looks like typed/racket now supports match? John smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

[racket] world/universe update model (functional update redux), using the I/O monad for state

2011-12-12 Thread John Clements
The holiday season: time to grade lots of projects, and "goof off" by thinking about how those programs could better be expressed. Here's a world/universe program written by one team in my class. It uses mutation all over the place: #lang racket (require (except-in (planet clements/rsound)

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

2011-12-13 Thread John Clements
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" issue, but perhaps I'm missing some vital difference between '

Re: [racket] world/universe update model (functional update redux), using the I/O monad for state

2011-12-13 Thread John Clements
On Dec 12, 2011, at 7:55 PM, Matthias Felleisen wrote: > > Is the below really much less natural to write? I really enjoyed playing the > qwerty row from left to right, or perhaps I was pressing the number keys at > the same time :-) You're cheating! Unless quasiquote is a new part of htdp/2e

Re: [racket] Multiple return values

2011-12-14 Thread John Clements
On Dec 14, 2011, at 6:15 AM, Matthias Felleisen wrote: > > CPS is for old people. Be careful. > > See Dybvig's paper on measurable benefits (or lack thereof) for values and > friends. You're referring to 1994, "An efficient implementation of multiple return values in Scheme" ? John smi

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

2011-12-19 Thread John Clements
On Dec 19, 2011, at 5:02 PM, Racket Noob wrote: > Jordan, beautiful are your ideas and suggestions, but unfortunately, I think > that they are futile. Why do I say this? I think that Racket primarily serves > to a specific group of people as an inexhaustible source for mass-production > of alw

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

2011-12-19 Thread John Clements
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)) I'm wondering if there's a way to get (in-range 127) to type-check at

Re: [racket] W: A Game Written in Racket

2011-12-21 Thread John Clements
versions of the game, the GitHub page is still in active > development, the submitted version is available as the ldjam branch). > > Anyway, I just thought some of you might think this was cool, so I hope you > take a look! Very cool! Much appreciate

Re: [racket] exception instead of EOF?

2011-12-26 Thread John Clements
On Dec 26, 2011, at 2:46 AM, Dmitry Pavlov wrote: > Hello, > > I would like to make read-byte and friends to > throw an exception in case end of file is > reached. That is, when I call read-byte, > I know that the byte must be there, otherwise > the input data is corrupt. I would prefer > not to

Re: [racket] compilation error in dherman/parameter

2011-12-26 Thread John Clements
On Dec 24, 2011, at 3:43 AM, Răzvan Rotaru wrote: > Hi, > > I stumbled upon a compilation in parameter.plt: > > . > ../../../../.racket/planet/300/5.1.3/cache/dherman/parameter.plt/1/3/main.ss:26:17: > compile: unbound identifier in module in: flat-get > > The broken code is following: > ;;

Re: [racket] XML library: representing CDATA

2012-01-03 Thread John Clements
On Jan 3, 2012, at 3:09 PM, Neil Van Dyke wrote: > I don't know what the *stock* XML parsing does, but I have used Oleg > Kiselyov's SSAX parser a lot in Racket-based production apps, and it does > handle CDATA. > > Oleg spent a lot of time on XML, including learning things about it that its

Re: [racket] Reading recommendation for static analysis?

2012-01-03 Thread John Clements
On Jan 2, 2012, at 6:40 PM, Patrick Li wrote: > Hello everyone, > > I am trying to accomplish the following task, and was wondering if anyone > knows of a fitting paper that I can read. I want to write a static analysis > tool for a small scheme-like language to catch simple typing errors. The

[racket] scribble -> ePub/mobi?

2012-01-04 Thread John Clements
Has anyone taken a look at generating ePub or mobi documents directly from scribble? As the owner of a Kindle, I can see that pdf/dvi/ps is terrible for these kind of on-the-fly reformatting systems. HTML is better, but trying to convert the existing HTML for HtDP 2e (I haven't tried removing t

[racket] Q. about intent of TR wrt floats

2012-01-05 Thread John Clements
I just had trouble with the type of log; I wanted to pass it a positive real, and get back a Real. After inspecting the type, I see that it works for Positive-Float. Is this deliberate, in order to get more optimizable code (if the input is a float, we don't need to check it), or just an overs

[racket] why does TR stop printing helpful "type (:print-type ) to see more" message ?

2012-01-05 Thread John Clements
It appears that TR only prints the message "[Use (:print-type ) to see more.]" once. I think this is the wrong choice, and that it should be printed every time. Totally unimportant, I know. Thanks! John Clements smime.p7s Description: S/MIME cryptographic

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

2012-01-05 Thread John Clements
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 scope of the type variable T? Apparently I can use it anywhere in the def

[racket] TR: predicate for a Float ?

2012-01-05 Thread John Clements
I'd like a predicate that checks whether a number is a Float. Here's what I tried: (: amplitudes/t (Listof Float)) (define amplitudes/t (cond [(andmap inexact-real? amplitudes) amplitudes] [(error 'impossible "Make TR happy")])) But

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

2012-01-06 Thread John Clements
On Jan 5, 2012, at 5:30 PM, Sam Tobin-Hochstadt wrote: > 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-Zer

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

2012-01-06 Thread John Clements
On Jan 6, 2012, at 8:39 AM, John Clements wrote: > > On Jan 5, 2012, at 5:30 PM, Sam Tobin-Hochstadt wrote: > >> On Fri, Jan 6, 2012 at 1:00 AM, John Clements >> wrote: >>> >>> Examining the difference between Inexact-Real and Float yields this: >&g

[racket] TR: (almost) no way to dismiss performance report window?

2012-01-06 Thread John Clements
On my mac, the window summoned by a double-click after running Performance Report has no close box, and no close buttons, and no obvious way to dismiss it. It turns out that choosing "Racket > Quit" from the menu gets rid of it, but on a Mac, this is *severely* unintuitive, as it appears that y

[racket] Calling TR modules from Racket modules is slow?

2012-01-06 Thread John Clements
I'm guessing this is a contract issue, but it looks to me like calls from racket into typed/racket are slow. To wit: #lang racket/load (module a typed/racket (provide float-add) (: float-add (Float Float -> Float)) (define (float-add a b) (+ a b)) (printf "a million in-module typed adds\n") (

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

2012-01-06 Thread John Clements
On Jan 6, 2012, at 9:19 AM, Vincent St-Amour wrote: > At Fri, 6 Jan 2012 08:47:39 -0800, > John Clements wrote: >> 1) Not all of the types printed in (:print-type Foo) are necessarily >> bound in the user code, right? I tried at one point substituting the >> result of (

Re: [racket] Teach yourself Racket in Fixnum Days?

2012-01-06 Thread John Clements
be the focus of the kind of guide you're looking for? John Clements smime.p7s Description: S/MIME cryptographic signature Racket Users list: http://lists.racket-lang.org/users

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

2012-01-06 Thread John Clements
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: >> >> #lang typed/racket >> >> (: f (All (T) (Number -> T -> T))) >> (def

[racket] Racket Google Hits

2012-01-08 Thread John Clements
Many people have better things to do than worry about our rank in the TIOBE programming languages index. For who care, then: we currently have "About 3,180 results (0.17 seconds)" for +"Racket Programming" on Google. 50K puts us in the top 50, something like 15-20K puts us in the top 100. John

Re: [racket] Racket Google Hits

2012-01-10 Thread John Clements
Related note: there's a new book out about Racket! Uh, more or less http://www.amazon.com/gp/product/1244213063/ref=cm_cr_mts_prod_img John smime.p7s Description: S/MIME cryptographic signature Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Calling TR modules from Racket modules is slow?

2012-01-10 Thread John Clements
On Jan 6, 2012, at 1:37 PM, Vincent St-Amour wrote: > At Fri, 6 Jan 2012 13:15:54 -0800, > John Clements wrote: >> Welcome to DrRacket, version 5.2.0.7--2012-01-05(fd5e40f/g) [3m]. >> Language: racket/load; memory limit: 256 MB. >> a million in-module typed adds >>

[racket] for Wikipedia: is rackunit an XUnit?

2012-01-10 Thread John Clements
For wikipedia, Is rackunit an XUnit? I said yes. Change if necessary: http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#Racket John Clements smime.p7s Description: S/MIME cryptographic signature Racket Users list: http://lists.racket-lang.org/users

[racket] Handin Server + PLAI problem

2012-01-12 Thread John Clements
wever, it's not *all* parameters that trigger the error; I can submit code containing (current-error-port) without incident. I've taken a quick look at the code, and I can't see how setting this parameter would trigger a call to current-directory. Any ideas? John Clements smime.p7

Re: [racket] Handin Server + PLAI problem [and 1 more messages] [and 2 more messages]

2012-01-15 Thread John Clements
On Jan 14, 2012, at 8:19 PM, Robby Findler wrote: > Perhaps the right thing is to have the setup code export a small > library that contains a "is my mark bound in the context" function and > then the sandbox can call that function when deciding whether or not > to grant permission. > > (That ha

Re: [racket] Engineering Tradeoffs of ANF transforms and the Stateless Server

2012-01-19 Thread John Clements
I think the below would make a good PLT blog post, perhaps with an opening paragraph about how much cheaper the stateless web-server can be. John On Jan 3, 2012, at 10:33 PM, Galler wrote: > > > On the subject of porting #lang racket to #lang web-server code > > I provide a few lessons le

[racket] #lang text ? #lang none ?

2012-01-19 Thread John Clements
Scribble tipped the balance for me; I now find myself using DrRacket to edit text files. As part of a quest for world domina^H^H^H^H^H^Hcompatibility, I'd like to add either #lang text or #lang none which could begin a text file and indicate that no highlighting should be done, and that e

Re: [racket] #lang text ? #lang none ?

2012-01-19 Thread John Clements
On Jan 19, 2012, at 12:17 PM, Tony Garnock-Jones wrote: > On 01/19/2012 02:52 PM, John Clements wrote: >> #lang text > > How about #lang text/plain ? (Leaving the way open for #lang text/xml and so > forth) (#lang application/octet-stream !) Yes, much nicer. John smime.

Re: [racket] class variables in racket

2012-01-19 Thread John Clements
On Jan 19, 2012, at 1:51 PM, Ryan Culpepper wrote: > The Racket class system doesn't have such a thing because it doesn't need it. > The idiomatic Racket alternative to "class variables" or "static members" is > to define the variable/constant/function at the top-level of the enclosing > modul

Re: [racket] #lang text ? #lang none ?

2012-01-20 Thread John Clements
On Jan 20, 2012, at 8:48 AM, Eli Barzilay wrote: > Yesterday, John Clements wrote: >> Scribble tipped the balance for me; I now find myself using DrRacket >> to edit text files. >> >> As part of a quest for world domina^H^H^H^H^H^Hcompatibility, I'd >>

[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) | (!

[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 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. Typ

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] PLaneT: Broken table of contents links in scribble

2012-02-02 Thread John Clements
On Jan 24, 2012, at 7:05 PM, Michael W wrote: > > P.S. Yes, I know (planet clements/rsound) is better, but I wanted > to practice with something a bit lower level. Plus, it's nice to > be able to stream raw sound data from a port instead of loading > it all into memory. ;) I don't mean to step on

[racket] comparing structure types through contracts

2012-02-06 Thread John Clements
I'm working with Dave Herman's JavaScript package. I've found a problem and a workaround, but I want to make sure there's not an easier workaround before I convert a bunch of code. The following program illustrates the issue: #lang racket/load (module a racket ;; this formulation "works"

Re: [racket] Porter stemming algorithm

2012-02-08 Thread John Clements
ssfully replaced all of the funny text quotes with regular ASCII ones, but I gave up when I noticed that apparently less-than signs were interpreted as HTML tag markers--it'll be easier just to ask for a non-damaged copy to be attached to the page somehow. John Clements smime.p7s Descr

[racket] standard solution for non-terminating handin tests?

2012-02-11 Thread John Clements
My students have terrible trouble with handin tests that don't terminate / exhaust memory. Specifically, the handin fails, and no test results are saved with the file in a SUCCESS directory. I think the underlying problem is that I'm using (add-header-line! ...) to record information about test

  1   2   3   4   5   6   7   8   9   10   >