Re: [racket-dev] Code micro-level organization

2012-06-01 Thread Eli Barzilay
[Combined reply] Two days ago, Jon Rafkind wrote: > On 05/30/2012 04:07 PM, Eli Barzilay wrote: > > > >> Having expressions come from the bottom, using the down arrow, seems > >> sort of wierd. > > Here's a concrete example: > > > > (○ (let ([x 10]) ↓) > > (for ([i (in-range x)]) ↓) > >

Re: [racket-dev] Code micro-level organization

2012-05-31 Thread Jay McCarthy
I know about package-begin, it's just not worth it if I need to bring in another require and add package-begin Jay On Thu, May 31, 2012 at 3:43 PM, Ryan Culpepper wrote: > On 05/31/2012 02:54 PM, Jay McCarthy wrote: >> >> I was clapping through the majority of your email. >> >> I want define* so

Re: [racket-dev] Code micro-level organization

2012-05-31 Thread Ryan Culpepper
On 05/31/2012 02:54 PM, Jay McCarthy wrote: I was clapping through the majority of your email. I want define* so bad. You can use define*; just put it inside of package-begin: > (require racket/package) > (package-begin (define* x 1) (define* x (+ 2 x)) x) 3 I don't thin

Re: [racket-dev] Code micro-level organization

2012-05-31 Thread Jay McCarthy
I was clapping through the majority of your email. I want define* so bad. I use compose and curry a lot (even though I know their performance problems) because it don't have to name things. I like the idea of the -> thing with the down and up arrows. I see a value in both arrows. I also like Jon

Re: [racket-dev] Code micro-level organization

2012-05-31 Thread Laurent
(sorry for the bad indentation, writing s-exps on a phone predictive keyboard is painful...) Le 31 mai 2012 19:21, "Laurent" a écrit : > How about a define* that is exactly like let* without the additional > indentation level? > E.g.: > > (define* > [↑ "foo bar baz"] > [↑ (substring ↑ 3 8)] > [st

Re: [racket-dev] Code micro-level organization

2012-05-31 Thread Laurent
How about a define* that is exactly like let* without the additional indentation level? E.g.: (define* [↑ "foo bar baz"] [↑ (substring ↑ 3 8)] [str (string-trim ↑)] [↑ (regexp-match? #rx"^[a-z].*[a-z]$" str)]) (and ↑ (string-append "*" str "*")) Laurent Le 31 mai 2012 19:04, "Neil Toronto" a éc

Re: [racket-dev] Code micro-level organization

2012-05-31 Thread Neil Toronto
On 05/30/2012 03:40 PM, Eli Barzilay wrote: Now, lets imagine that instead of a simple `<>' hole, there are two kinds of holes with an "up" or a "down" direction -- this leads to this kind of a syntax: (○ "foo bar baz" (substring ↑ 3 8) (string-trim ↑) (let ([str ↑]) ↓)

Re: [racket-dev] Code micro-level organization

2012-05-30 Thread Jon Rafkind
On 05/30/2012 04:07 PM, Eli Barzilay wrote: > >> Having expressions come from the bottom, using the down arrow, seems >> sort of wierd. > Here's a concrete example: > > (○ (let ([x 10]) ↓) > (for ([i (in-range x)]) ↓) > (for ([j (in-range i)]) ↓) > ...etc...) > > Do you have a conc

Re: [racket-dev] Code micro-level organization

2012-05-30 Thread Eli Barzilay
A few minutes ago, Jon Rafkind wrote: > On 05/30/2012 03:40 PM, Eli Barzilay wrote: > > Now, lets imagine that instead of a simple `<>' hole, there are two > > kinds of holes with an "up" or a "down" direction -- this leads to > > this kind of a syntax: > > > > (○ "foo bar baz" > > (substrin

Re: [racket-dev] Code micro-level organization

2012-05-30 Thread Jon Rafkind
On 05/30/2012 03:40 PM, Eli Barzilay wrote: > Now, lets imagine that instead of a simple `<>' hole, there are two > kinds of holes with an "up" or a "down" direction -- this leads to > this kind of a syntax: > > (○ "foo bar baz" > (substring ↑ 3 8) > (string-trim ↑) > (let ([str ↑]

[racket-dev] Code micro-level organization

2012-05-30 Thread Eli Barzilay
I'm going to ramble a bit about organizing code, trying to look for an idea for a good solution -- so spread a few kgs of salt over the following (if you care to read it). The problem that I'm talking about has several manifestations. The most obvious one is code-drift towards the RHS. A less ob