Re: [racket] How to invoke a blocking foreign function without blocking whole racket?

2013-01-31 Thread Sam Phillips
On Wed, Jan 30, 2013 at 6:16 AM, Laurent laurent.ors...@gmail.com wrote: On Wed, Jan 30, 2013 at 3:06 PM, Haiwei Zhou highfl...@gmail.com wrote: Cool! The open-fd-input-port is a great function. Yes, indeed. Maybe something like this would be a useful addition to Racket. Yet another

Re: [racket] minimum spanning tree

2012-12-03 Thread Sam Phillips
I always thought that an implementation of FGL would be nice. http://web.engr.oregonstate.edu/~erwig/fgl/ Cheers, Sam On Mon, Dec 3, 2012 at 11:34 AM, Stephen Chang stch...@ccs.neu.edu wrote: I have a half-finished graph library based on the C++ boost library and racket generics to support

Re: [racket] Looping with look-behind and look-forward

2012-05-27 Thread Sam Phillips
On Sun, May 27, 2012 at 8:46 AM, Harry Spier vasishtha.sp...@gmail.com wrote: (define (f1 l)   (for/fold ([result-list '()])    ( [prior (in-list (append '() l))]      [x (in-list l)]      [next (in-list  (append (rest l) '()))])    ...    ... make new-result-element using x prior and

Re: [racket] playing with upcoming racket 5.3 submodules feature

2012-04-19 Thread Sam Phillips
On Wed, Apr 18, 2012 at 17:19, Danny Yoo d...@cs.wpi.edu wrote: I'm playing around with submodules with a small toy program:    https://gist.github.com/2417377 Submodules are neat!  In particular, it includes several submodules for different roles. In case other people are interested, here

Re: [racket] happy april fools day: arctangent 0.1

2012-04-03 Thread Sam Phillips
On Mon, Apr 2, 2012 at 01:12, Neil Van Dyke n...@neilvandyke.org wrote: Arctangent is more practical than the DrBASIC that I started but didn't get back to in time for April 1st.  (Line numbers, and everything.  And who of us who were tots in the '80s realized that NEXT A wasn't necessarily

Re: [racket] Racket Google Hits

2012-01-10 Thread Sam Phillips
On Tue, Jan 10, 2012 at 09:11, John Clements cleme...@brinckerhoff.org wrote: 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 [somewhat OT] GAH! Books like this suck. My wife was looking for a copy

Re: [racket] string-strip

2011-12-27 Thread Sam Phillips
On Tue, Dec 27, 2011 at 09:55, Marijn hk...@gentoo.org wrote: Sometimes I wish for python-like string-strip to be a standard function. For example when I want to parse a list of numbers from a text-field, I could get the string value of the text-field, strip space from the beginning and end,

Re: [racket] Graphics Issues in Ubuntu 11.10

2011-10-17 Thread Sam Phillips
Ideally you could just cherry-pick Matthew's change as a patch and apply that during the build of the deb until the next official Racket release is made. http://en.wikipedia.org/wiki/Debian_build_toolchain#Patch_systems Cheers, Sam On Mon, Oct 17, 2011 at 17:52, Jon Rafkind rafk...@cs.utah.edu

Re: [racket] For new Racket users

2011-08-27 Thread Sam Phillips
On Sat, Aug 27, 2011 at 10:10, Robby Findler ro...@eecs.northwestern.edu wrote: It made me want to make a similar puzzle for learning Racket. But I don't know how effective such things are. A few months ago I was looking at a job posting that had a several puzzles that involved Javascript and

Re: [racket] another mini-tutorial: a racket slice: munging IRC logs

2011-08-06 Thread Sam Phillips
On Sat, Aug 6, 2011 at 02:36, Neil Van Dyke n...@neilvandyke.org wrote: BTW, I suspect someone will find this in Google when they're trying to talk with an IRC server from Racket, and be disappointed that this is only about parsing a particular log format.  I think that there is some IRC client

Re: [racket] how do you raise a runtime error with source location information?

2011-06-20 Thread Sam Phillips
On Mon, Jun 20, 2011 at 20:38, Grant Rettke gret...@acm.org wrote: On Mon, Jun 20, 2011 at 10:00 PM, Robby Findler ro...@eecs.northwestern.edu wrote: I don't know if there is one already that is a good match for what you want, but you can always use prop:exn:srclocs to make a new one. Feels

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

2011-03-21 Thread Sam Phillips
On Mon, Mar 21, 2011 at 9:42 AM, Patrick Li patrickli.2...@gmail.com wrote: How should I proceed from here? These are the options that I've come up with: (1) Optimize variable lookup. Currently the environment is represented as a list of key-value pairs. Variable lookup is done by searching

Re: [racket] Fetching a Web page?

2011-02-14 Thread Sam Phillips
On Mon, Feb 14, 2011 at 10:20 AM, m...@goblin.punk.net wrote: Is there a procedure to fetch a Web page? I'm probably looking in the wrong places for it. I found the Racket Networking Libraries, but I'm not familiar with Web sockets. Check out get-pure-port and related functions in the

Re: [racket] ffi/unsafe examples

2011-02-07 Thread Sam Phillips
On Mon, Feb 7, 2011 at 10:51 AM, Ben Dean benjamin.d...@aya.yale.edu wrote: I'm not clear, however, on what the particular object files I'm looking up with ffi-lib. I also am unclear about the convention for the function-name parameter to get-ffi-obj. Is it as simple as a string of the the name

Re: [racket] openssl - authenticating clients via certificates

2011-01-05 Thread Sam Phillips
On Wed, Jan 5, 2011 at 4:37 AM, Curtis Dutton curtd...@gmail.com wrote: Has anybody figured out a way to do this yet?  I am willing to volunteer some effort to help implement. Any pointers on where to get started, design considerations, etc... are appreciated if that is the case. I've not

Re: [racket] read text file

2010-12-06 Thread Sam Phillips
On Mon, Dec 6, 2010 at 6:52 PM, Sam Phillips samdphill...@gmail.com wrote: On Mon, Dec 6, 2010 at 6:43 PM, prad p...@towardsfreedom.com wrote: but what am i supposed to in racket? (other than read-line right through to the end of the file, may be?) In unstable/port there is read-all.  Which

Re: [racket] CGI headers

2010-11-09 Thread Sam Phillips
On Mon, Nov 8, 2010 at 9:37 PM, scouic sco...@gmail.com wrote: What's wrong here ? Must i write #lang racket at the top, must i change mzscheme.exe with gracket.exe ... ? I don't really understand why i've an apache internal server error ... ps : in my apache httpd.conf i've the line

Re: [racket] Using lex and yacc

2010-10-12 Thread Sam Phillips
On Tue, Oct 12, 2010 at 11:12 AM, Mark Carter mcturra2...@yahoo.co.uk wrote: Are there any examples on using lex and yacc, as I'm having trouble getting started. I am trying to write a simple calculator. Here's what I've got so far: #lang racket/base (require parser-tools/lex) (define

[racket] try/catch/finally idiom in Racket

2010-10-08 Thread Sam Phillips
Hi All, I understand using call-with-exception-handler/with-handlers/etc. to catch exceptions in a block of code, but I'm at a loss to what the best way to do a finally or cleanup action after a block of code. My intuition is to use dynamic-wind, but I figure there may be a better way that I

Re: [racket] try/catch/finally idiom in Racket

2010-10-08 Thread Sam Phillips
On Fri, Oct 8, 2010 at 4:40 PM, Jay McCarthy jay.mccar...@gmail.com wrote: I use dynamic-wind for this. If there is something better, I don't know what it is. dynamic-wind is a little bit funny though because if you capture continuations then the in/out handlers can run multiple times which