On Dec 23, 12:00=A0am, "Abinoam Jr." <abin... / gmail.com> wrote:
> http://www.pastie.org/1399777
>
> 1) I don't think you need an Array of Hash. Just a Hash.
> 2) I used "eval" to do what you want
>
> Was it something like this what you wanted?
>
> Abinoam Jr.
>
> On Thu, Dec 23, 2010 at 1:40 AM, Ryan Davis <ryand-r... / zenspider.com> wr=
ote:
>
> > On Dec 22, 2010, at 20:10 , RichardOnRails wrote:
>
> >> I pasted code to prompt for a couple of parameter-values at
> >>http://www.pastie.org/1399710.
>
> >> Running this code under SciTE produces, for example:
> >> Getting parms
> >> =A0 =A0 =A0 Account Number: 123
> >> =A0 =A0 =A0 Report =A0Period: 456
> >> Showing parms
> >> =A0 =A0 =A0 @acct_num =3D 123
> >> =A0 =A0 =A0 @acct_period =3D 456
>
> >> It is excessively verbose because I couldn't figure out how to use
> >> meta-language to specify the parameter target names.
>
> > It is excessively verbose because you wrote 53 lines when 4 would do:
>
> > print "Account Number: "
> > @acct_num =3D gets.to_i
> > print "Report =A0Period: "
> > @acct_period =3D gets.to_i
>
> > There is nothing wrong with that code. It doesn't have to be 13x more c=
omplex to ask the user 2 simple questions.
>
> > The definition of DRY is "Every piece of knowledge must have a single, =
unambiguous, authoritative representation within a system" not "ZOMG I see =
a 2 line pattern! must kill!"
>
> > Please. Do the simplest thing that could possibly work.
>
> > P.S. AGAIN with the tabs. I almost didn't write this email at all just =
because reading your code is too hard.
>
>

Hi,

> 1) I don't think you need an Array of Hash. Just a Hash.
You're right.  That's much better

> 2) I used "eval" to do what you want
>
> Was it something like this what you wanted?

I thought about eval,  but I didn't know how to apply it to get result
that you did.  Your solution is EXACTLY the kind of solution I
imagined but couldn't implement.

Thank you very much,
Richard