Forums

Visitor pattern in Cobra

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Visitor pattern in Cobra

Postby Charles » Mon Jul 07, 2008 9:57 pm

Actually this class would work fine with any CLR language including C# and VB. It's likely that Visitor will get into the Cobra standard library, enabling you to quickly pound out a visitor pattern in any Cobra program. Feedback welcome.
Attachments
visitor.cobra
The Visitor Pattern in Cobra, version 1
(5.39 KiB) Downloaded 562 times
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Visitor pattern in Cobra

Postby Charles » Wed Jul 09, 2008 10:18 pm

Ack, I uploaded the wrong file. This new one is much the same, but the docs are slightly improved.
Attachments
visitor-lang.cobra
The Visitor Pattern in Cobra, version 2
(6.41 KiB) Downloaded 591 times
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Visitor pattern in Cobra

Postby Charles » Wed Aug 13, 2008 4:38 pm

Btw this made it into the Cobra standard library, so the "Visitor" class is now available by default. It's a rather small, but useful class. Inside CobraLang.cobra, you'll find a doc string explaining how it works.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 94 guests

cron