[Aiml-programr-developers] New graphmaster "node" class completed
Nicholas H.Tollervey
ntoll at ntoll.org
Mon Oct 22 16:44:33 EDT 2007
Guys,
I've integrated Mauro's code back into my node class. Please take a look
and comment.
Now, I want to "refactor" what is currently the "evaluate" method now
that I know about array.shift, other Rubyisms and guards. That we have a
pretty extensive suite of tests should make this quite a lot of fun as
stuff gets broken and put back together again. Nevertheless, I'd be
interested to know how I might refactor "if...then" flow out of the
evaluate method in an attempt to make the thing more Rubyesque (what a
lovely word!) but I won't peek at the current version (as I'm determined
to think this through and learn by doing rather than copying).
Anyway, I'll be in touch very soon when I've had time to get something
done (1-2 days).
Best wishes,
Nicholas
mauro at cicio.org wrote:
> Micholas,
>
>
>> All sounds good to me. I like the idea of comparing old/new... that way
>> we can be certain that the code in the lib has earned its place... also
>> I like the opportunity to learn. :-)
>>
>
> Me too! Honestly: I am very happy to have this pR coming back to life.
> The previous version was too much oriented to get the bare minimum to
> work (for Tiresia), and too little attention was therefore paied to my
> best love: clean design and good coding :-)
> Very happy to have professional developers to discuss this topics with.
>
>
>> I'll take an in-depth look at your new file / comments tomorrow during
>> lunch and will reply in depth very soon.
>>
>
> Fine,
>
>
>> As I think I mentioned in a previous email, I'm intentionally not
>> looking at the "current" node class so we can do an untainted compare
>> and contrast.
>>
>
> Good idea. Honestly, I don't even remember the old one.I think I have
> never seen some parts of it. But learning by contrast is a good thing
> for all of us, I fully agree.
>
>
>> However, I've obviously quickly skimmed through your new
>> file. I'm really going to enjoy this!
>>
>
> :-)
>
>
>> Some quick points: I agree with using the metaphors as it makes the code
>> easier to understand - a good thing.
>>
>
> Good... me too, as you know, even if sometimes I am lazy in looking
> for the good metaphores and I end up using "getters and setters" whic,
> of course, is better than a bad metaphore.
>
>
>> Also, seeing how you've refactored
>> my clunky Ruby is certainly an eye opener.
>>
>
> Your Ruby is good, man! I have seen much worse code in a lot of plugins.
> Obviously you are a very good programmer, with an eye for neat code.
> My refactoring is only there because it is the fastest way to show
> some ideas on how we can take advantage of Ruby's features to develop
> a more concise, still very expressive, style.
>
>
>> Coming from C# (where there
>> is no obvious equivalent) just using the Array.shift method makes things
>> a whole lot easier. In addition, I like how "unless" is used to get rid
>> of pesky if...else.
>>
>
> I am very glad of this. If you like this things, our collaboration
> will be very easy.
>
>
>> Finally, I think it important that we include some
>> means of referencing the origin of a template in the graphmaster as this
>> is extraordinarily useful when debugging AIML (see the "source" argument
>> in my add_category method).
>>
>
> Right. Is there a class we might invent, that wraps all theis
> divverent parameters, so that the meaning of this class will make the
> code more readable?
> I mean: CleverName.source
>
> Ciao,
> Mauro
>
>
More information about the Aiml-programr-developers
mailing list