The Artima Developer Community
Sponsored Link

Articles Forum
If It's Not Nailed Down, Steal It

3 replies on 1 page. Most recent reply: Jun 29, 2008 2:29 PM by Rich Morin

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
James Britt

Posts: 21
Nickname: jbritt
Registered: Mar, 2003

If It's Not Nailed Down, Steal It Posted: May 22, 2006 11:00 PM
Reply to this message Reply
Advertisement
Topher Cyll explores Ruby implementations of assorted language features more typically found in Standard ML, Haskell, and Common Lisp.

Read this Ruby Code & Stlye article to learn more.

http://www.artima.com/rubycs/articles/patterns_sexp_dsls.html

What did you think of Topher's article and examples?


Christopher Cyll

Posts: 49
Nickname: topher
Registered: Jan, 2006

"Stealing it back" Posted: Jun 2, 2006 10:27 AM
Reply to this message Reply
Richard Cook has great post about how to implement the Logo example from above in Common Lisp.

http://i-need-closures.blogspot.com/2006/06/stealing-it-back.html

Very cool!
Topher

Rich Morin

Posts: 3
Nickname: rdm
Registered: Jan, 2006

Re: If It's Not Nailed Down, Steal It Posted: Jun 27, 2008 11:23 PM
Reply to this message Reply
Very interesting article. I recently wrote RubyKif, a class that parses and emits the PowerLoom variant of KIF (Lisp-style predicate calculus).

I used Treetop, so I'll be interested to compare the size and complexity of my solution to yours. I also map tokens to symbols, though I translate numbers and strings across. FWIW, I also translate comments to symbols.

Although this is a simple and robust mapping, turning a KIF operator such as :<<=>> into the Ruby symbol :':<<=>>' does nothing to improve its readability (:-).

http://cfcl.com/twiki/bin/view/Projects/Arti/Patterns/RubyKif_H2

I've been wondering about stealing something else, BTW. The jQuery library has some really powerful mechanisms for dealing with DOM trees. Shouldn't Ruby be able to use the same mechanisms on random lists of lists?

Rich Morin

Posts: 3
Nickname: rdm
Registered: Jan, 2006

Re: If It's Not Nailed Down, Steal It Posted: Jun 29, 2008 2:29 PM
Reply to this message Reply
Note: In order to make the parse_sexp example work, I had to require sexpressions, rather than sexp.


PowerLoom's variant of KIF includes syntax that this library does not handle: exponential notation (eg, "1.2e3"), two kinds of comments (eg, ";...\n", '#|...|#'), and a slew of symbolic operators ranging from "=" to ":<<=>>".
It may be a while before I am in a position to compare them on an equal footing...

Flat View: This topic has 3 replies on 1 page
Topic: Testing Multithreaded Java Code Previous Topic   Next Topic Topic: Large JVM Memory and Garbage Collection

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use