- Lisp is just so feature rich. Its taking many workarounds to (almost)direct port telnetlib from lisp to scheme.
- Domain knowledge is important. I always thought it was easy to understand the domain and I could just start with anything and I started this project without knowing much about telnet protocol itself and Now I realise that to do it I *have* to understand the nuances of it.
[Update] Its completed.
"Lisp is just so feature rich. Its taking many workarounds to (almost)direct port telnetlib from lisp to scheme."
ReplyDeleteunless you are using some particularly available-in-lisp-only library, this doesn't sound valid.
Besides which you shouldn't be "direct porting" ;-).
Understand the telnet protocol (independent of language) and then use the scheme native idioms to implement. Use the lisp library as a reference only. my 2 cents!
thanks, I realised that "direct porting" was not gonna work and hence it changed into "(almost)direct" porting.
ReplyDeleteBTW, the features which make life easy in lisp(from this exercise it seems atleast) are &key, &optional in the procedure parameters; a very intelligent format function; loop macro and availability of return and return-from to unconditionally exit the procedure.
"&key, &optional in the procedure parameters; "
ReplyDeleteThis is justa differents style of formatting and when you shift t thinking in scheme (vs writing lisp in scheme) you'll be all right ;-)
"a very intelligent format function;"
yes this is a convenience, but people do write substabtial code with System.out.println ;-)
"loop macro"
This is one of the most grungy pieces of lisp. In scheme you should be using recursion to get iteration
"availability of return and return-from to unconditionally exit the procedure"
Agin this is fine *in lisp*. How would you code the same functionality in say Oz or HAskell, let alone scheme.
I guess what I am saying code with the grain of the language, not against it!
aargh i meant different style of *programming* not formatting
ReplyDeleteJust putting a link to your blog-entry : http://runningupstairs.blogspot.com/2009/05/some-guidelines-on-porting.html
ReplyDeletevery relevant(to this thread) and informative. I can pretty much "feel" 1st, 2nd and 3rd rule. :)
For using recursion for iteration. I know it works fine(and very functional) but I guess a do-while or do-until sort of wrapper(can be a macro that in turn uses recursion, and I like loop bcoz it can pretty much do all those loopings) makes the intent clear for a person reading the code.... just my thoughts :)
ReplyDelete"Liking loop" is good *in Common Lisp* ;-)
ReplyDeleteWhen using scheme, use "scheme- isms". As you rightly said, if you think do until" etc is needed to make intent clear, write a scheme function/macro/whtever it takes.