Re: Factoring Arguments

2007-12-21 Thread Larry Wall
On Fri, Dec 21, 2007 at 08:41:54AM -0800, Jonathan Lang wrote: : I'm wondering if something similar could be done for optional : arguments - something along the lines of "within the following block, : assign value V to argument X of routine R by default." This would : allow for a similar "factorin

Re: Factoring Arguments

2007-12-21 Thread Juerd Waalboer
Ryan Richter skribis 2007-12-21 11:52 (-0500): > On Fri, Dec 21, 2007 at 08:41:54AM -0800, Jonathan Lang wrote: > > and so on, you might do something like: > > with &qq :(c => false) { > I think this can be done with normal currying, something like > temp &circumfix:<" "> := "e:.assuming(:!c); H

Re: Factoring Arguments

2007-12-21 Thread Jonathan Lang
Ryan Richter wrote: > Jonathan Lang wrote: > > and so on, you might do something like: > > > > with &qq :(c => false) { > > I think this can be done with normal currying, something like > > temp &circumfix:<" "> := "e:.assuming(:!c); That handles the specific example that I had in mind, but does

Re: Factoring Arguments

2007-12-21 Thread ajr
> > A number of languages have a "with ..." construct that's intended to > cut down on repetitive typing, I hope I will be excused for dragging in the indecency, but it might be worth looking at the concepts COBOL used to mitigate its verbosity, (e.g. types defined in a structure that get inherit

Re: Factoring Arguments

2007-12-21 Thread Ryan Richter
On Fri, Dec 21, 2007 at 08:41:54AM -0800, Jonathan Lang wrote: > and so on, you might do something like: > > with &qq :(c => false) { I think this can be done with normal currying, something like temp &circumfix:<" "> := "e:.assuming(:!c); -ryan

Factoring Arguments

2007-12-21 Thread Jonathan Lang
I'm thinking aloud here, so please bear with me. A number of languages have a "with ..." construct that's intended to cut down on repetitive typing, by factoring the invocant out of every method call. Perl 6 also has this, in the form of "given ...": given $foo.bar.baz { .dothis(); .do