For Programmers: Free Programming Magazines  


Home > Archive > Scheme > April 2005 > How I stopped worrying and learned to love the bangs (was Re: Looking









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How I stopped worrying and learned to love the bangs (was Re: Looking
Sunnan

2005-04-21, 4:00 am

Abdulaziz Ghuloum wrote:
> Here is another rpn (also with no error handling, interactivity, ...).
> It also assumes that all operators are binary.
> Also, this rpn has no side effects.


Yours is pure functional, but mine doesn't have any external
side-effects (does that phrasing make sense?). I *used* bangs internally
for brevity, but my rpn still just take stuff in, and put stuff out. I'd
still use it in an otherwise pure functional program. I toyed with
something that looked like your program for a while before things
settled down, and my factorings were made.

I actually found the pure functional version harder to debug/grok as I
was writing it; it juggles a lot more state around, explicitly, and it's
longer.

An interesting property of your program is that it's iterative, mine is
recursive. (And the fact that it had to be *reverse* polish notation
complicated my program (remove the reverse line and switch b and c, and
call it pn), while yours work with it.)

I guess you always think the version you write yourself looks the
clearest...
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com