Re: [racket] SWIFT IS AWESOOOOOME!!!!!

2014-06-07 Thread Gregory Woodhouse
One of the first things that attracted me to Racket was the possibility of programming OS X or maybe even iOS applications in a Lisp-like language. That, and the promise of being able to build more robust (maybe provably correct is too strong?) applications for healthcare applications. Sent fr

Re: [racket] File name case when saving in Win 7

2013-03-02 Thread Gregory Woodhouse
Windows does save names in mixed case, but file name comparisons are case insensitive. I'm not sure normalizing case before saving is actually correct. Sent from my iPhone On Mar 2, 2013, at 12:10 PM, "David T. Pierson" wrote: > On Fri, Mar 01, 2013 at 10:59:06PM -0700, Danny Yoo wrote: >> In

Re: [racket] Realm of Racket

2013-02-08 Thread Gregory Woodhouse
Love the video! I used to say I wished I could recommend Racket for enterprise development. But no more. Recent developments, such as the math and db libraries make it an excellent choice. Sent from my iPhone On Feb 8, 2013, at 8:10 AM, Matthias Felleisen wrote: > > > NoStarch and O'Reilly

Re: [racket] Racket equivalent to RubyMotion

2012-12-12 Thread Gregory Woodhouse
Very cool. It's available for iOS, too. Gambit v4.6.4 > (+ 5 2) 7 > (define (f x) (+ x 1)) > (f 4) 5 >  Sent from my iPhone On Dec 12, 2012, at 8:56 AM, Hendrik Boom wrote: > Not Racket, but still Scheme. There'a a Gambit app on Android. Racket Users list: http://l

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? __

[racket] Mutation of structure elements

2012-10-31 Thread Gregory Woodhouse
I've been thinking about whether how to implement matrices in Racket. One obvious option is just to use a vector ;;a matrix with data stored in the vector data (struct matrix (rows cols [data #:mutable])) and then entries can be retrieved simply enough ;;return the (i, j)th element of m ;;row

Re: [racket] A small little random tutorial

2012-10-20 Thread Gregory Woodhouse
It's funny how working out the probabilities doesn't seem to help. The paradox is truly stubborn. I can explain why changing doors is the right thing to do, but it still doesn't " feel" right. Sent from my iPhone On Oct 20, 2012, at 8:49 PM, Neil Toronto wrote: > On 10/20/2012 05:15 PM, Dann

Re: [racket] A small little random tutorial

2012-10-20 Thread Gregory Woodhouse
write down every result my dad > got and then see how random they really were." > > On Sat, Oct 20, 2012 at 6:43 PM, Gregory Woodhouse > wrote: >> You could have some fun with this. For example, what is the entropy of a >> sequence of 1000 (or 1) rolls of the dic

Re: [racket] A small little random tutorial

2012-10-20 Thread Gregory Woodhouse
You could have some fun with this. For example, what is the entropy of a sequence of 1000 (or 1) rolls of the dice? Sent from my iPhone On Oct 20, 2012, at 4:15 PM, Danny Yoo wrote: > http://hashcollision.org/vegas-blues/ > > The tone ended up being a bit bluer than I expected, hence the

Re: [racket] Function composition in Racket

2012-10-16 Thread Gregory Woodhouse
Indeed it does! These plots are very nice. On Oct 16, 2012, at 1:35 PM, Neil Toronto wrote: > On 10/16/2012 12:02 PM, Michael Wilber wrote: >> Does surface3d and isosurface3d from racket/plot do what you want? >> >> file:///usr/share/racket/doc/plot/renderer3d.html?q=isosurface#(def._((lib._plo

Re: [racket] Function composition in Racket

2012-10-16 Thread Gregory Woodhouse
I'm intrigued. I suppose pattern based macros could be used to implement operations like + and *, and passing to the field of quotients should formally be no different from rational arithmetic. Are you interested in Chebyshev polynomials for a particular reason (e.g, applications to differential

Re: [racket] Function composition in Racket

2012-10-15 Thread Gregory Woodhouse
I suppose I'm just stating the obvious here, but R[x, y] is naturally isomorphic to R[x][y]. That is, polynomials in x and y over the ring R have a natural interpretation as polynomials in y over the ring R[x] of polynomials over R. So, if you had a good library for working with polynomials (of

Re: [racket] Function composition in Racket

2012-10-14 Thread Gregory Woodhouse
Uh... never mind. I should have looked for the obvious > (define (f x) (+ x 1)) > (define (g x) (* x x)) > ((compose f g) 1) 2 > ((compose f g) 2) 5 > On Oct 14, 2012, at 4:00 PM, Gregory Woodhouse wrote: > Now, my question is: is there a notation in Racket for represent

[racket] Function composition in Racket

2012-10-14 Thread Gregory Woodhouse
I wrote a small recursive function to convert a list (a0 a1 ... an) coefficients into a polynomial function ;;Given a list (a0 a1 ... an) return a function that computes ;;p(x) = a0 + a1*x + ... + an*x^n (define (polynomial coeffs) (lambda (x) (cond [(= (length coeffs) 0) 0] [

Re: [racket] HTTP-POST byte string gets truncated

2012-10-06 Thread Gregory Woodhouse
I'm not sure what's going on, but the HTTP protocol specifies that the header and message body be separated by \r\n\r\n. Sent from my iPhone On Oct 6, 2012, at 3:50 AM, Mikko Tiihonen wrote: > Hi, again! > > I'm continuing to build a small HTTP-client. The problem is now that the POST > par

Re: [racket] Sum of Even

2012-09-25 Thread Gregory Woodhouse
You may have shown in a mathematics class that 1 + 2 + ... + n = n(n + 1)/2 Do you recall how you did it? What was the induction step? Sent from my iPhone On Sep 25, 2012, at 8:04 AM, Ashley Fowler wrote: > I am trying to do a recursive analysis on the Sum of even numbers function. > So far

[racket] Contracts in interfaces

2012-09-24 Thread Gregory Woodhouse
In writing contracts for classes I always use the ->m constructor for methods, so this example of section 5.1 of the Reference surprises me (define file-interface<%> (interface () open close read-byte write-byte)) (define directory-interface<%> (interface (file-interface<%>) [file-list (

[racket] Confused by augment and inner

2012-09-23 Thread Gregory Woodhouse
I am trying to understand how augmentable methods (as described in section 13.5 of The Guide) work. Between the extremes of allowing arbitrary overriding and disallowing overriding entirely, the class system also supports Beta-style augmentable methods [Goldberg04]. A method declared with pubme

Re: [racket] Contracts on subclasses/mixins

2012-09-10 Thread Gregory Woodhouse
52 -0700, Gregory Woodhouse wrote: >> Now, here's my question. provide grid% with its own contract-out >> clause. It seems rather redundant (and presumably unnecessary) to >> repeat the methods from base-grid% in the contract for grid%. > > You don't need t

[racket] Contracts on subclasses/mixins

2012-09-10 Thread Gregory Woodhouse
I have a contract (define base-grid/c (class/c (given? (->m coord? coord? boolean?)) (get-cell (->m coord? coord? digit?)) (get-cell/given (->m coord? coord? (values digit? boolean?))) (set-cell! (->m coord? coord? digit? void?)) (set-given! (->m coord? coord? digit? void?)) (c

Re: [racket] tinyscheme vs. racket question

2012-09-10 Thread Gregory Woodhouse
Is there a similar function for characters? I.e., one that will map #\1 to 1? Sent from my iPhone On Sep 10, 2012, at 9:44 AM, Carl Eastlund wrote: > The following expression should do what you want: > > (+ (string->number "1.2") 1) > > If you're starting from a symbol, use symbol->string bef

Re: [racket] Exception not being caught?

2012-09-04 Thread Gregory Woodhouse
My eyes were deceiving me. Sorry about that. Sent from my iPhone On Sep 4, 2012, at 10:53 AM, Tobias Hammer wrote: > >>> (sudoku) >> Cannot open file /Users/gregwoodhouse/sudoku/puzzles/puzzle-4a.sdk >> #(struct:exn:fail:filesystem call-with-input-file: cannot open input file >> path: /Users

[racket] Exception not being caught?

2012-09-04 Thread Gregory Woodhouse
This is strange (to me, anyway). I have two modules: grid.rkt which implements a Sudoku grid but provides no graphical representation, and sudoku.rkt which is responsible for handling the GUI. All updates to the board are sent to the grid object (called grid-model here). Now, in my rudimentary u

Re: [racket] with-handlers and exception structure

2012-09-03 Thread Gregory Woodhouse
(if (cdr x) (srcloc-source (cdr x)) "") > (if (cdr x) (srcloc-line (cdr x)) ""))) >(continuation-mark-set->context (exn-continuation-marks exn))) > "\n")) > > ;; Example usage: > (with-handlers ([exn:fail? (comp

[racket] with-handlers and exception structure

2012-09-03 Thread Gregory Woodhouse
Dumb question: If an exception is handled by (lambda (e) ... ) is it possible to recover exception details such as any message that may have been used in a raise or related statement? Racket Users list: http://lists.racket-lang.org/users

[racket] Newbie question: creating a custom canvas

2012-08-23 Thread Gregory Woodhouse
I apologize in advance for the elementary nature of this question, and for the amount of code included below. I'm having a tough time following the documentation for racket/gui and racket/draw. My first attempt to create a Sudoku grid follows the example in the documentation rather slavishly and

Re: [racket] Implementing an equal? method for a class

2012-07-31 Thread Gregory Woodhouse
> > > On Jul 29, 2012, at 6:00 PM, Eli Barzilay wrote: > >> Yesterday, Gregory Woodhouse wrote: >>> (define b(make-vector 9 (make-vector 9 0))) >> >> BTW, this is wrong -- it builds a vector of 9 zeros, then uses that >> same vector 9 times: >

Re: [racket] Checking for exceptions in RackUnit

2012-07-30 Thread Gregory Woodhouse
Thanks. On Jul 30, 2012, at 12:16 PM, David Van Horn wrote: > check-exn should take a thunk as the second argument. I think you want: > > (test-begin > (define x (new grid%)) > (check-exn exn:fail? >(lambda () > (send x set-cell! 1 1 1) > (send x set-cell!

[racket] Checking for exceptions in RackUnit

2012-07-30 Thread Gregory Woodhouse
Okay, here's another question related to my little Sudoku project. Before I decided to switch to using rackunit for runit tests, I had a unit test that looked like this (define (test3) (let ([val 'fail] [g (new grid%)]) (with-handlers ([exn:fail? (lambda (exn) (set! val 'pass))

Re: [racket] Implementing an equal? method for a class

2012-07-28 Thread Gregory Woodhouse
Perfect. That's just what I was looking for. Sent from my iPhone On Jul 28, 2012, at 7:42 PM, Vincent St-Amour wrote: > You could have `simple-grid%' implement the `equal<%>' interface. > > http://docs.racket-lang.org/reference/objectequality.html?q=equal%3C%25%3E#%28def._%28%28lib._racket/pr

[racket] Implementing an equal? method for a class

2012-07-28 Thread Gregory Woodhouse
Okay, this is really a newbie question, but here goes. I have a class that represents a Sudoku grid. Internally, the grid is stored as a vector of vectors of integers: (define simple-grid% (class object% (super-new) ;b is an internal representation of the grid and is initiali

Re: [racket] What math do you want to do in Racket?

2012-07-01 Thread Gregory Woodhouse
A good linear algebra package is a foundation for a surprising amount of numerical mathematics. Sent from my iPhone On Jul 1, 2012, at 6:45 AM, Patrick King wrote: > Stats and linear algebra will be welcome, gamma function, too. I also find > myself rolling my own integration functions. > >

[racket] A simple lexer question

2012-06-19 Thread Gregory Woodhouse
I want to write a rule that will recognize strings in a language (MUMPS) that doubles double quotes as a means of escaping them. For example "The double quote symbol is \"." would be "The double quote symbol is ""." and "\"" would be . That seems simple enough except that I need to write reg

Re: [racket] a question of style, and one of performance

2012-01-08 Thread Gregory Woodhouse
I suppose it could prevent certain optimizations in parameter passing, forcing space for arguments to be allocated on the heap. Sent from my iPad On Jan 8, 2012, at 12:42 PM, Danny Yoo wrote: > On Sun, Jan 8, 2012 at 3:23 PM, Jordan Schatz wrote: >> This code runs, but I'm guessing that its

Re: [racket] Documentations in PDF/PS format

2012-01-04 Thread Gregory Woodhouse
I find it very convenient to load documentation on an e-reader. PDF isn't the only format to consider, either. EPUB and MOBI (for the Kindle) often work better. On Jan 4, 2012, at 7:57 AM, Matthias Felleisen wrote: > Pardon my lack of knowledge. I haven't gotten interested in e-readers yet. >

Re: [racket] article about Racket

2011-11-13 Thread Gregory Woodhouse
Same here. As I said in a previous message, I give DrRacket high marks for usability. On Nov 13, 2011, at 6:27 AM, Harry Spier wrote: > Robby Findler wrote: > > I have spent a fair amount of time trying to keep the clutter out of > the UI --- . . . But it is a battle that I figh

Re: [racket] DrRacket needs work

2011-11-12 Thread Gregory Woodhouse
I'm not sure if this is really a matter of either/or - from a usability standpoint, I find DrRacket excellent, but it does seem a bit old-fashioned in some ways. I frankly find it a bit difficult to say just how. I know it doesn't look like Eclipse (and, yes, it wasn't hard to guess that the per

Re: [racket] arity of + versus <=

2011-10-30 Thread Gregory Woodhouse
Think about arithmetic mod 2. Multiplication is AND and addition is XOR. So the multiplicative identity 1 corresponds to TRUE. It just happens that the additive identity 0 works for OR, but that's not a perfect analog since 1 + 1 = 0 (2). On Oct 28, 2011, at 9:55 AM, Carl Eastlund wrote: > No.

Re: [racket] Racket in the large

2011-08-20 Thread Gregory Woodhouse
It seems to me that Racket would be more widely used if there were database drivers for major DBMSs (e.g., PostgreSQL, SQLite, MySQL. maybe even Oracle) as part of the standard distribution. I know there are PLaneT packages available, but it would sure be easier for potential adopters if they ca

Re: [racket] Call racket from racket on MacOSX, no response

2011-07-26 Thread Gregory Woodhouse
Could this be a path issue? There's no need to find the racket executable in the case of ls. Sent from my iPad On Jul 26, 2011, at 9:54 AM, Niitsuma Hirotaka wrote: > The following code works on linux. > But on MacOSX, no response > -- > #lang racket > (require racket/system) > (display (

Re: [racket] OT: SU(2) and friends

2011-04-23 Thread Gregory Woodhouse
Now, that's quite a find! On Apr 23, 2011, at 7:34 AM, Hendrik Boom wrote: > You can also find similar stuff in Manning's book, The Geometry of Four > Dimensions. I have it as a Dover paperback that I bought in the > fifties or sixties, but nowadays it seems to be available as a free > downlo

Re: [racket] SU(2) and friends

2011-04-22 Thread Gregory Woodhouse
Clifford algebras (which are non-associative) are higher dimensional generalizations of H (the quaternions), so in the case of SU(2), you don't really need the machinery of Clifford algebras. That being said, I'm not entirely sure what you are looking for. Ordinary rotations (the circle group)

[racket] SU(2) and friends

2011-04-22 Thread Gregory Woodhouse
I meant to get back to this earlier. You might want to look at Geometry of Representation Spaces in SU(2) - advanced, but with some real gems http://arxiv.org/pdf/1001.2408 The Quaternions and the Spaces S3, SU(2), SO(3), and RP3 http://www.cis.upenn.edu/~cis610/cis610sl7.pdf The first of these

Re: [racket] Query for Gregory Woodhouse

2011-04-19 Thread Gregory Woodhouse
me off-line. On Apr 18, 2011, at 1:17 AM, Paul Ellis wrote: > Dear Gregory Woodhouse > > Unrelated to Racket – I’m interested in the Geometry of 2 Complex Dimensions > (“G2CDs”) and came across your 2006 post: > > [plt-scheme] 3rd-8th Grade > > Gregory Woodhouse gr

Re: [racket] Web server "Server" header

2011-04-12 Thread Gregory Woodhouse
The relevant section is 14.38: 14.38 Server The Server response-header field contains information about the software used by the origin server to handle the request. The field can contain multiple product tokens (section 3.8) and comments identifying the server and any significant sub

Re: [racket] Can raco exe assign a name other than "racket"?

2011-03-26 Thread Gregory Woodhouse
Could it be that the issue is not argv[0] at all, but the way the program is launched by xinetd? I'm guessing that this is a daemon process. Sent from my iPad On Mar 26, 2011, at 2:28 PM, Hugh Myers wrote: > Don't know about 'do by default', but since command line switches are > already being

Re: [racket] Can raco exe assign a name other than "racket"?

2011-03-26 Thread Gregory Woodhouse
On Mar 26, 2011, at 9:14 AM, Greg Hendershott wrote: > I'm not sure if this is a Linux or Racket question or both. > > $ raco exe -o foo foo.rkt > $ ./foo & > $ ps #shows it as "racket" not as "foo". > $ top #shows it as "racket" not as "foo". > > Is there way I can make it show up as "foo"?

Re: [racket] Providing structures from modules

2011-03-25 Thread Gregory Woodhouse
Ah... I must have made some other error (typo?) because I thought that syntax was giving me an error. I works fine. On Mar 25, 2011, at 2:05 PM, Jay McCarthy wrote: > (struct m-value (raw interp flag)) > (provide (struct-out m-value)) > > just like before. > > Jay smime.p7s Description: S/M

[racket] Providing structures from modules

2011-03-25 Thread Gregory Woodhouse
I'm accustomed to using the following syntax to define structure types in a module (define-struct m-value (raw interp flag)) (provide (struct-out m-value)) but I see that the documentation (Reference, sec. 4.1) says that the form define-struct is provided for backward compatibility, and struct

Re: [racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Gregory Woodhouse
This may sound overly simplistic, but have tried profiling your application? Where does it spend the majority of its time? Sent from my iPhone On Mar 21, 2011, at 9:42 AM, Patrick Li wrote: > Hello everyone, > > For educational purposes, I've implemented a simple Scheme interpreter in C, > b

[racket] call-with-composable-continuation vs. call/cc

2011-03-20 Thread Gregory Woodhouse
If I write a trivial loop using call/cc (call/cc (lambda (k) (define (loop) (let ([x (read)]) (if (eq? x '()) (k x) (loop (loop))) It does exactly what I expect. If I type anything but () it reads again, but if I type () it prints out '() and quits W

Re: [racket] preference: 32-bit or 64-bit racket?

2011-03-09 Thread Gregory Woodhouse
The same is true of 64-bit OS X. I was a little surprised that there were no pre-built 64-bit binaries for OS X. On Mar 9, 2011, at 2:37 PM, Greg Hendershott wrote: > Oh I didn't realize that, I thought it still experimental-ish. That's great. > > Building Racket on Windows has seemed daunting.

Re: [racket] "three uses of macros" + wikipedia

2011-03-09 Thread Gregory Woodhouse
Mar 9, 2011, at 9:27 AM, Gregory Woodhouse wrote: > >> I'm trying to locate this page. What is the URL? > > Which page? The Wikipedia page on Macros? it's here: > > http://en.wikipedia.org/wiki/Macro_%28computer_science%29 > > The posting I referred to is

Re: [racket] contracts and the wikipedia article for Racket

2011-03-09 Thread Gregory Woodhouse
Thanks. I've updated the Wikipedia article accordingly. On Mar 9, 2011, at 9:40 AM, Robby Findler wrote: > This is the paper that first introduced the idea: > > Contracts for Higher-Order Functions > Findler, Felleisen > International Conference on Functional Programming (ICFP) 48-59 2002 >

[racket] contracts and the wikipedia article for Racket

2011-03-09 Thread Gregory Woodhouse
I notice that the Wikipedia article for Racket (a little sparse in my opinion) http://en.wikipedia.org/wiki/Racket_(programming_language) asserts that Racket was the first higher order language to use a contract system, but that statement has been flagged as needing a citation to back it up. W

Re: [racket] "three uses of macros" + wikipedia

2011-03-09 Thread Gregory Woodhouse
I'm trying to locate this page. What is the URL? On Mar 9, 2011, at 9:04 AM, John Clements wrote: > I just added some text to Wikipedia page for Macros, citing the "3 uses of > macros" posting to the ll1 mailing list. Is there a better reference for > this? > > John _

Re: [racket] Liitin screencast tutorial

2011-03-05 Thread Gregory Woodhouse
My first thought was that it was a bit like MUMPS with its global variables (where global means global among processes and users, not just global in scope). It seems to me that persistence is the right way to do that. The versioning reminds me a bit of WebDAV, or even VMS. Sent from my iPad O

Re: [racket] Multiplying by 0

2011-02-14 Thread Gregory Woodhouse
It's a puzzle > (define (mymin a b) (if (< a b) a b)) > (mymin 0 1e100) 0 > (mymin 1e100 0) 0 > On Feb 14, 2011, at 12:47 PM, David Van Horn wrote: > Then what is the correct definition? _ For list-related administrat

Re: [racket] Multiplying by 0

2011-02-14 Thread Gregory Woodhouse
I see your point. On Feb 14, 2011, at 12:14 PM, Sam Tobin-Hochstadt wrote: > No, it's not a bug. Since 1e100 is an inexact number, there's > uncertainty about the minimum of those two numbers, and the result is > therefore inexact. > > On Mon, Feb 14, 2011 at 3

Re: [racket] Multiplying by 0

2011-02-14 Thread Gregory Woodhouse
Oops... Now that has to qualify as a bug. On Feb 14, 2011, at 11:58 AM, Joe Marshall wrote: > 2011/2/13 José Lopes : >> I understand. However, not only that disregards type promotion but also is >> incoherent since (+ 0 0.0) evaluates to 0.0. > > Worse: > (min 0 1e100) => 0.0 > > -- > ~jrm __

Re: [racket] question about permutation

2011-02-13 Thread Gregory Woodhouse
You just wrote down the permutations of the set {1, 2, 3}. What was your thought process in producing this list? Sent from my iPad On Feb 13, 2011, at 4:42 PM, Xiaojian Wang wrote: > I want to make a permutation of a word, for example 1 2 3 > > it should return > 1 2 3 > 1 3 2 > 2 1 3 > 2 3

Re: [racket] using planet from embedded application

2011-02-13 Thread Gregory Woodhouse
This is a good example of why I'd like to see interfaces to SQLite, PostgreSQL and MySQL included in the main racket distribution. Not including them seems like a rather odd omission. On Feb 13, 2011, at 12:37 PM, gabor papp wrote: > 'm trying to require jaz's mysql package like this: > (requir

Re: [racket] Writing UTF-16 to a socket/file

2011-02-12 Thread Gregory Woodhouse
Thanks, everyone. This is just what I was looking for. Sent from my iPad On Feb 12, 2011, at 4:53 PM, Robby Findler wrote: > Oh, yes, that looks right to me. > > Robby > > On Sat, Feb 12, 2011 at 2:54 PM, Neil Van Dyke wrote: >> Won't "reencode-output-port" let you write Racket strings as U

[racket] Writing UTF-16 to a socket/file

2011-02-12 Thread Gregory Woodhouse
Is it possible to ensure that data written to a socket or file is encoded as UTF-16? I ask because Health Level 7 (HL7) 2.5.1 allows messages to use UTF-16 as opposed to US-ASCII, but it has to be a fixed width encoding. _ For list-related adminis

Re: [racket] Opening

2011-02-12 Thread Gregory Woodhouse
I remember using a Lisp as an undergraduate (Franz Lisp?) that used the right angle bracket as a kind of super right parenthesis that could close multiple right parentheses. It was really ugly. On Feb 12, 2011, at 4:43 AM, Todd O'Bryan wrote: > And now I have unresolved tension...