[racket] request for "check"

2014-11-04 Thread Adam Shaw
Glad to see "check-satisfied" enter the pantheon. A request: "check": test passes if expression(s) evaluate to true, otherwise fails. ex: (check (ascending? (sort list))) ex: (check (> x 0) (< y 0)) Cheers -ams Racket Users list: http://lists.racket-lang.org/users

Re: [racket] color does not match like other structs

2012-08-29 Thread Adam Shaw
Thanks, Danny. This fix seems fine if you're willing to dial up to #lang racket, but I'm interested in doing this in *SL, for my students (for whom syntactic consistency is desirable and very important). I suppose I could build my own variant of 2htdp/image which includes the require you give he

[racket] color does not match like other structs

2012-08-29 Thread Adam Shaw
Hi all -- This came up perhaps a year ago; I'm writing about pattern matching with the color struct that comes with 2htdp/image. It is inconsistent with struct matching generally. In the following excerpt, bar and baz are fine, but foo (commented out) causes an error (match: color does not ref

[racket] apparent doc bug

2011-11-17 Thread Adam Shaw
One of my students found this -- it seems fixed on the web, but the (hard-drive local) docs for or and and seem to be swapped for student languages. I'm running 5.1.3 [3m] on my computer and I see the same mix-up. Here's a doc path which I hope is helpful: file:///Applications/Racket-v5.1.3/doc

Re: [racket] profiling

2011-11-10 Thread Adam Shaw
Excellent! This is very helpful -- thanks! Regards, Adam On Nov 10, 2011, at 9:44 AM, Robby Findler wrote: > Turning on profiling is an action in the Language dialog. It needs to > be set up before your program is compiled (which the below doesn't > do). > > Robby

Re: [racket] profiling

2011-11-10 Thread Adam Shaw
Thanks -- although when I tried this a dialog popped up saying "There is no profiling information available. Please be sure that profiling is enabled..." So, I added two lines of code above the def'n of even?: (require errortrace) (profiling-enabled #t) Same dialog pops up even so. Regards, A

[racket] profiling

2011-11-10 Thread Adam Shaw
Can someone point me to instructions and/or tutorial materials on how to profile programs in DrRacket? I would appreciate it. Thanks! Regards, Adam _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

[racket] Fwd: interaction between (require racket) and check-expect

2011-11-05 Thread Adam Shaw
e racket)? There's probably some smaller >> library you could use that would not shadow core things... >> >> Robby >> >> On Sat, Nov 5, 2011 at 8:54 AM, Adam Shaw wrote: >>> Hi -- >>> My students noticed that certain check-expect tests stop work

[racket] interaction between (require racket) and check-expect

2011-11-05 Thread Adam Shaw
Hi -- My students noticed that certain check-expect tests stop working in the presence of (require racket). For example, the check-expect in this three-line file fails under ISλ: (require racket) (define-struct foo (x)) (check-expect (make-foo 0) (make-foo 0)) Why is this happening? Thanks --

[racket] syntax coloring issue?

2011-11-02 Thread Adam Shaw
Greetings -- My students have alerted me to an apparent syntax-coloring problem in DrRacket. Try typing this file -- you have to type *the second line first*, then go up to a prior line and type *any three Greek letters* (not necessarily distinct) -- ;; ααα ;; something is funny with this line

Re: [racket] match in Advanced Student?

2011-10-31 Thread Adam Shaw
It's the same error with or without. Here's the error: match: color does not refer to a structure definition Here are two complete source files (no teachpacks), running Adv. Student, DrRacket 5.1.3. ;; begin file 1 (match (make-color 1 2 3) [(struct color (r g b)) (+ r g b)]) ;; begin file 2

Re: [racket] match in Advanced Student?

2011-10-31 Thread Adam Shaw
Thanks! That still doesn't work for color: match: color does not refer to a structure definition although it does work with my own custom color struct: (define-struct clr (r g b)) (match (make-clr 1 2 3) [(struct clr (r g b)) (* r g b)]) - Adam On Oct 31, 2011, at 9:26 PM, Jay McCarthy w

Re: [racket] match in Advanced Student?

2011-10-31 Thread Adam Shaw
Since pattern matching has been a topic of discussion lately -- I'm trying to get simple pattern matching to work in Adv. Student -- for example this expression: (match (make-color 1 2 3) [(make-color r g b) (* r g b)]) gets this response match: expected a pattern, but found a part I wou

[racket] greek letters/Windows

2011-10-14 Thread Adam Shaw
How does one type Greek letters into DrRacket on Windows? I'm looking at DrRacket 5.1.3 on Windows 7. Thanks -- Regards, Adam _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

[racket] check-fact would be nice...

2011-10-13 Thread Adam Shaw
Forgive me if the following already exists in Racket, but I would appreciate if something like (check-fact ) (or check-pred, check-truth, whatever) as an alternative to (check-expect true) Seems like it would be a reasonable addition. Cheers - Adam

[racket] provide in ISL

2011-10-13 Thread Adam Shaw
Greetings -- Wondering about the possible inclusion of provide in the student languages, say ISL. I'm interested to hear the rationale for its exclusion. It seems worthwhile to promote modular programming and fair to introduce early. Regards, Adam ___

[racket] Fwd: drracket language (in the spoken language sense)

2011-09-28 Thread Adam Shaw
Forgot to say -- he's using Mac OS X Lion. Regards, Adam Begin forwarded message: > From: Adam Shaw > Date: September 28, 2011 4:14:11 PM CDT > To: Racket-users > Subject: [racket] drracket language (in the spoken language sense) > > A student asked me today if h

[racket] drracket language (in the spoken language sense)

2011-09-28 Thread Adam Shaw
A student asked me today if his DrRacket (menus, etc.) can be in English even though his system language is set to Korean. Is this possible? I suspect not, but thought I'd ask. Regards, Adam _ For list-related administrative tasks: http://l

Re: [racket] extract text?

2010-11-01 Thread Adam Shaw
Thanks for all your pointers. I've downloaded Eli's script and it's perfectly adequate for us. Much appreciated! Regards, Adam On Nov 1, 2010, at 11:40 AM, Eli Barzilay wrote: > I once wrote a script that does that -- you can find it at > barzilay.org/hacks.html -- but it might need some dus

[racket] extract text?

2010-11-01 Thread Adam Shaw
Hi all -- I'm grading a lot of racket files this quarter. A question: is there a widget to extract the text from a .rkt file? In other words, we'd like less of this > 0 0 14 3 3 #"num" > 0 0 22 3 1 #")" > 0 0 128 3 1 #" " > 0 0 14 3 3 #"num" > 0 0 22 3 1 #"]" > 0 0 128 29 1 #"\n" > 0 0 128 3 4

Re: [racket] reading a file in student languages

2010-10-20 Thread Adam Shaw
Yes! That's what I need & more. Thanks for the quick response. - Adam On Oct 19, 2010, at 4:14 PM, Matthias Felleisen wrote: > > Is 2htdp/batch-io as documented something you might find useful? > > > On Oct 19, 2010, at 3:58 PM, Adam Shaw wrote: > >> Hi --

[racket] reading a file in student languages

2010-10-19 Thread Adam Shaw
Hi -- Could someone tell me how to read in a data file in Int. Student or Adv. Student? I'd like something like (define dict (read "/path/to/dict")) and bind dict to a list of strings. Thanks in advance. Regards, Adam _ For list-related