Re: [racket] learn racket in 10 minutes

2013-07-14 Thread Richard Lawrence
Hi Roger, This is cool, thanks for putting it together! Roger Rousseau writes: > It's largely inspired from the Clojure version and the Racket documentation > I would be grateful for any corrections/suggestions before I send a pull > request to get this online Here are a couple of (tiny) sugge

Re: [racket] Offtopic: Favorite resources for mastering Prolog [was: SML]?

2013-07-06 Thread Richard Lawrence
Mark Engelberg writes: > While we're on the topic of exploring from Racket to alternative languages, > what's the friendliest way to dip into Prolog coming from a Racket > background? Well, there's the Racklog module: http://docs.racket-lang.org/racklog/ There's also the Datalog language: htt

Re: [racket] Style or and/define

2013-06-12 Thread Richard Lawrence
I wrote a macro once to `flatten' this kind of idiom, because I was writing code where I was doing a *lot* of this. It lets you mix let-style bindings with tests that throw an error if they fail. Warning: there is almost certainly a better way to write it (it is among the first `real' macros I wr

[racket] Parser-tools: `nesting' parsers?

2012-05-06 Thread Richard Lawrence
Hi everyone, I have a question about the parser-tools library (which is great!). I'm hoping maybe someone has run into this use-case before and figured out a solution. What I'd like to be able to do is `nest' parsers -- i.e., have one parser's grammar include terminal symbols which are not token

Re: [racket] what kind of Racket editor operations would you like to see?

2011-07-15 Thread Richard Lawrence
Hi Neil, I am an Emacs user, but have so far stuck with DrRacket as I learn Racket; apologies if my suggestions are features that are already available in Quack/Meow. 1. An operation that I always find myself wanting is something like ``wrap next sexp'' that would put parentheses around the next

Re: [racket] TR Regression: Types for regexp operations

2011-06-20 Thread Richard Lawrence
Eli Barzilay writes: > There is a "submit bug report" in DrRacket's help menu. You can also > use bugs.racket-lang.org, though the former is better. Got it, thanks. _ For list-related administrative tasks: http://lists.racket-lang.org/listinf

[racket] TR Regression: Types for regexp operations

2011-06-19 Thread Richard Lawrence
Hi Typed Racket folks, I checked out the development version of Racket today, and noticed what I believe to be a regression: TR thinks that regexp-match and friends return a String when given an Input-Port, but in fact they return Bytes: ; as expected: string input returns String (regexp-match #r

Re: [racket] Typed Racket: limited polymorphism?

2011-06-17 Thread Richard Lawrence
Thanks, Ray, Sam, and Matthias for the information and your suggestions. Ray Racine writes: > Define the node structure and constructor in a library. Then use > appropriate concrete constructor function(s) as needed. > [...] I'm still working through this one, but I think Ray's idea is bas

[racket] Predicates for instantiated types in Typed Racket

2011-06-17 Thread Richard Lawrence
Hi all, I think I must be missing something about how Typed Racket predicates work. If I define a predicate for an instantiated polymorphic structure, my programs type check fine, but I get runtime errors when I try to use the predicate, which boil down to "expected procedure, given: #". Here

Re: [racket] typed racket and new racket languages?

2011-06-16 Thread Richard Lawrence
Hi Raoul, > to what degree can one leverage typed racket for new languages in the > racket ecosystem? (You mean for *creating* new languages, right?) I'm actually in the middle of doing this right now. > tho i read that even if there are ways to use it, there be dragons in > terms of getting t

[racket] Typed Racket: limited polymorphism?

2011-06-14 Thread Richard Lawrence
Hi all, I have another question about whether something is possible in Typed Racket. What I would like to do is define a polymorphic structure where the polymorphism is limited to a certain subset of types. Again, I'm not sure I'm using the terminology correctly, so here's an example. Right now

Re: [racket] Typed Racket: Infinite Subtypes?

2011-06-10 Thread Richard Lawrence
Sam Tobin-Hochstadt writes: > I'll try to respond more comprehensively about the more general > question, but for this: >> (define-type Variable (Pair 'var Symbol)) >> (define-predicate variable? Variable) > > Just use a struct: > > (struct: variable ([s : Symbol])) > > Now you have `variable' an

[racket] Typed Racket: Infinite Subtypes?

2011-06-10 Thread Richard Lawrence
Hi Racketeers, I'm wondering if there's a way to specify a type in Typed Racket that is an infinite subtype of an existing type. (Not sure if I'm using the terminology correctly; by "subtype" I just mean a type whose values are a subset of another type's values.) For example, suppose I want to sp

Re: [racket] Regex for blank line?

2011-06-08 Thread Richard Lawrence
Hi Jon, Thanks for your help! > I have functions below that pass your tests, but a lot depends on what > you count as whitespace (not to mention newlines, since one of your > comments suggests that you want to match all Unicode > line-terminators). The functions below assume that "newline" means

[racket] Regex for blank line?

2011-06-08 Thread Richard Lawrence
Hi everyone, I'm sure this is a really trivial question, but I've been trying on my own for some time now, and I can't quite figure it out. I am trying to define a pair of functions, skip-whitespace and skip-blank-line, that do the following: - skip-whitespace should consume any whitespace chara

Re: [racket] `assert' in Typed Racket

2011-05-24 Thread Richard Lawrence
Sam Tobin-Hochstadt writes: > (assert x p?) is equivalent to (if (p? x) x (error ...)) except that > the result is known to have the appropriate type (here `String'). Ah, OK, I think I see my mistake; is this the right way to put it? Although the expression (assert x string?) has type String,

[racket] `assert', `and' and `or' in Typed Racket

2011-05-24 Thread Richard Lawrence
Hi everyone, I've been starting out learning Typed Racket, which I've enjoyed quite a lot -- thanks! I've run into a snag several times now that I wanted to ask the experts about: does TR know about short-circuiting `and' and `or'? (If not, why not?) If so, how do they interact with `assert'?

Re: [racket] Exploratory programming?

2010-12-02 Thread Richard Lawrence
Bojan Nikolic writes: > I've been using geiser recently (https://github.com/jaor/geiser) -- it > is already quite usable for the type of exploration that you mention > (e.g., listing all exported procedures in a module) and seems to be > evolving rapidly. Looks cool, thanks for the pointer! Ric

Re: [racket] Exploratory programming?

2010-12-01 Thread richard . lawrence
Hi Eli, > BTW, if you tried just that, then note that you can also an identifier > to jump directly to its definition: > > (help lambda) > > This uses the *syntactic* information from the system, for example: > > (define kons cons) > (help kons) > > won't work because `kons' is a new identif

Re: [racket] Exploratory programming?

2010-12-01 Thread richard . lawrence
[Apologies if this gets mis-threaded; I'm switching between Gmane and the mailing list address.] > On Dec 1, 2010, at 1:20 AM, Eli Barzilay wrote: > >>> >>> Examples: comparing Python's help function to Racket's as a tool for >>> introspecting objects at the REPL >>> [...] (define (f x y) >>>

Re: [racket] Exploratory programming?

2010-12-01 Thread richard . lawrence
> > On Dec 1, 2010, at 1:20 AM, Eli Barzilay wrote: > >>> >>> Examples: comparing Python's help function to Racket's as a tool for >>> introspecting objects at the REPL >>> [...] (define (f x y) >>>(+ x y)) (help f) >>> Not found in any library's documentation: f >> >> This is because

Re: [racket] Exploratory programming?

2010-11-30 Thread Richard Lawrence
Hi Matthias, > It isn't clear to me whether you have tried > > > (help "lambda") > > in your emacs repl. If so, do you object to the browser coming up with > intensively hyperlinked documentation? Or do you not like the format? (Evidently I had not. Now that is embarrassing. I could swear

[racket] Exploratory programming?

2010-11-30 Thread Richard Lawrence
Dear Racketeers: Apologies in advance for what will probably be a long-winded newbie question. I'm wondering how one goes about "exploring" the Racket libraries. That is, how does one find out things like: 1. which modules are likely to contain functions useful for a particular task 2. what nam

Re: [racket] Plea for neologism (was: Re: letoverlambda)

2010-11-24 Thread Richard Lawrence
Richard Cleis writes: > These two threads remind me of an observation that I wish I could cite: > > "Debugging programs is harder than writing programs. Those who write > programs at the limits of their ability are unqualified to debug > them." You might be thinking of this: "Debugging is twice

Re: [racket] Super basic question about strings

2010-11-17 Thread Richard Lawrence
Neil Van Dyke writes: > For new students, I would show them examples like Eli and Matthias > did. For production work, I usually build up strings using string > ports. > > Compared to various ways of building lists and doing "string-append", > or to simply doing lots of incremental "string-appen

Re: [racket] Super basic question about strings

2010-11-17 Thread Richard Lawrence
Matthias Felleisen writes: > On Nov 17, 2010, at 2:40 AM, Eli Barzilay wrote: > >> (define (alist->string alist) >> (string-join >> (for/list ([a (in-list alist)]) >> (format "~a=~a" (car a) (cdr a))) >> " ")) > > > Somewhat more 'native': > > (define (alist->string l)

[racket] Super basic question about strings

2010-11-16 Thread Richard Lawrence
Dear Racketeers: Ok, I feel really silly asking this, because I feel like I am missing something really conceptually basic, but the answer isn't apparent to me from the examples in the Guide: What's the right way to programatically build up strings in Racket? For example, suppose I want to consu

Re: [racket] Lisp game development on Reddit

2010-11-09 Thread Richard Lawrence
Matthias Felleisen writes: > We should start with a Racket version for Land of Lisp. > It would be much nicer in the Universe world than in an > old Lisp world. I think this would be really cool! I was thinking of doing this for my own edification. It might be fun for interested parties to

Re: [racket] Possible to install both plt-scheme from repo and racket from racket-lang.org?

2010-08-23 Thread Richard Lawrence
> For what it's worth, I have filed a Debian bug requesting that they > update the existing plt-scheme package to Racket: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593614 > Seems I was a bit hasty in filing this bug; this work is already underway. See: http://git.debian.org/?p=collab-m

Re: [racket] Possible to install both plt-scheme from repo and racket from racket-lang.org?

2010-08-23 Thread Richard Lawrence
Hi all, > On Aug 15, Laurent wrote: >> On Sat, Aug 14, 2010 at 18:54, Todd O'Bryan wrote: >> >> > One of my dreams has been to write a script of some sort that >> > would build a .deb for Eli automatically when he packages up the >> > latest version. Then it could be uploaded to the Ubuntu repo a