singletons

michael at optusnet.com.au michael at optusnet.com.au
Sun Dec 28 12:30:32 CET 2003


David Relson <relson at osagesoftware.com> writes:
> On 28 Dec 2003 11:16:29 +1100
> michael at optusnet.com.au wrote:
[..] 
> I like the MLOG idea.  'Tis more elegant.  I'll have to give it a try.

:)
 
[..] 
> I haven't fully grokked your code, yet.  Having a stack seems like
> overkill, but I need to examine it more thoroughly.

Possibly, but I wanted to be able to play around with word triples et
al later. (I was also keen on having the lexer be able to add hints
'in-line' so I previously had a 'push_token' function to add items to
the stack..)
 
> My thoughts involved caching the current and previous words and having a
> state variable that toggles between GET_NEW_WORD and RETURN_WORD_PAIR. 
> I think that would be enough to have get_token() alternate between
> returning a new word and returning a word pair.  Changing the tag
> (head:, rcvd:, to:, etc) would do an appropriate reset so a word pair
> wouldn't be built from (say) the From: and To: lines.  I've thought
> about this, but haven't implemented it.

My experience was that it was a little more complicated than that
due to trying to work out what 'owned' the memory of the current
token! That accounts for more than 1/2 the code in the patch. 
I'm pretty sure it stil isn't perfect. :(

Michael.




More information about the Bogofilter mailing list