[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [Terminology] What's the Ruby/OO name for this paradigm?

e

2/3/2005 8:16:00 PM

Martin DeMello wrote:
> E S <eero.saynatkari@kolumbus.fi> wrote:
>
>>In my current project, one of the main paradigms is code such as in
>>the following example. I'm wondering if there's a Ruby/OO designation
>>for it so that I wouldn't have to always show some excerpt when
>>describing the project. It's sort of an inverse continuation passing
>>scheme (which, in itself, isn't exactly a prime OO term).
>
>
> Technically currying, but from the example it looks like the intent is
> simply function wrapping.

I suppose not quite currying either--although it's a fair terming. I'm
thinking (in the context of the actual application which you obviously
didn't have the benefit of witnessing) maybe a 'monadic state'.

> e.g. we do this a lot at work:
>
> one(args) {
> ensure thread safety;
> return two(args)
> }
>
> two(args) {
> ensure constraint satisfaction;
> return three(args)
> }
>
> three(args) {
> do the actual work;
> return the actual result;
> }
>
> Is that the same thing you're using it for?

Not quite though the basic structure is the same. Essentially a state
and an environment is built/augmented while building up the stack and
there are certain operations performed while unwinding. In the end,
the computation is stored for use a bit later.

I should probably have mentioned that this is, at this stage, a
more-or-less direct translation of an O'Caml project of mine :)

I agree with you three, though, I think I'll just implement this in
a more straightforward manner to begin with and refactor. Thanks!

> martin

E