On Fri, Feb 27, 2009 at 02:19:56PM +0900, Martin DeMello wrote:
came up with it.
Please let me know if you figure it out.
On Fri, Feb 27, 2009 at 02:19:56PM +0900, Martin DeMello wrote:
came up with it.
Please let me know if you figure it out.
On Fri, Feb 27, 2009 at 04:47:37PM +0900, Leo wrote:
 Â
^ Parse error,
Wandering does not
compute.
Damn. Typo.
On Wednesday 25 February 2009 05:53 pm, Chad P. wrote:
I’m not sure how that “seems funny”, considering you just confirmed
some
of what I said – that RPN parsers are easier to write than Polish
notation parsers.
Maybe somebody can clarify / remind me of the terminology (it’s been a
long time since I really dealt with that stuff–pre-1970 iirc).
Anyway, I remember RPN (Reverse Polish Notation) which is like 3 3 +
I remember infix (notation?) (which is like 3 + 3 =)
Then I remember there was the “inverse” of RPN, which is like + 3 3
(iirc)–is that what you’re calling Polish notation (it makes sense,
just wasn’t sure) (I think maybe we just called it something like
prefix notation–we referred to prefix, infix, and postfix, with
postfix being RPN)
What I remember is that writing compiler type stuff in RPN (or to
handle RPN) was much easier than for infix notation. I don’t remember
doing experimentation with prefix, but I assume we must have (it was
that kind of school).
Randy K.
Randy K. [email protected] writes:
Anyway, I remember RPN (Reverse Polish Notation) which is like 3 3 +
I remember infix (notation?) (which is like 3 + 3 =)
Then I remember there was the “inverse” of RPN, which is like + 3 3
(iirc)–is that what you’re calling Polish notation (it makes sense,
just wasn’t sure)
Would the “inverse” of reverse polish notation be polish notation?
[3,3,:+].inverse → undefined method `inverse’ for [3, 3, :+]:Array
Seems that’s nonsense… On the other hand:
[3,3,:+].reverse → [:+, 3, 3]
Pascal J. Bourguignon wrote:
or simply to try and
make your Ruby code look as much like Lisp as posisble, or … ?Yes, definitely. It makes me feel if not at home, at least, at a
strange aunt’s, vs. in a totally strange home in a totally strange
land.
This tends to prove the hypothesis that Commune Lisp users are
incapable of becoming fluent in other languages. They lack the
ability to change and to grow; their minds seem to be fossilized.
They believe that the evolution of programming languages ended
with FORTRAN.
In the beginning (1920s / 1930s) there was one notation, with
parentheses. We now call that infix, but I don’t think it had a name
because it was the only notation anybody used. Then Lukaciewicz
invented Lukaciewicz notation, which was a prefix notation – operator
followed by operands. Nobody could spell or pronounce his name, so it
became known as Polish notation because he was Polish. It was still
prefix and not widely used until the early days of programming
language.
Then came reverse Polish or postfix notation. So now we have three
notations:
Polish, aka prefix
Reverse Polish, aka postfix
normal, aka infix
–
M. Edward (Ed) Borasky
http://www.linkedin.com/in/edborasky
I’ve never met a happy clam. In fact, most of them were pretty steamed.
On Sun, Mar 01, 2009 at 12:14:01AM +0900, Pascal J. Bourguignon wrote:
Would the “inverse” of reverse polish notation be polish notation?
[3,3,:+].inverse -> undefined method `inverse’ for [3, 3, :+]:Array
Seems that’s nonsense… On the other hand:
[3,3,:+].reverse -> [:+, 3, 3]
Actually, it’s not so much that Polish notation is the reverse of
Reverse
Polish Notation, but that RPN is the reverse of Polish notation. Ahem.
If I recall my efforts correctly, though, the implementation of Polish
notation felt more like the “inverse” of RPN than either being the
“reverse” of the other. In fact, implementing prefix notation felt a
bit
like turning RPN inside out.
Pascal J. Bourguignon wrote:
(if mandatory (e = fieldAccess) (ib = [["." , e , :begin]]) (ie = [["." , e , :end]]) else (e = [[ "." , fieldAccess , :getValuePtr]]) (ib = [["->" , e , :begin]]) (ie = [["->" , e , :end]]) end)
e, ib, ie =
if mandatory
[ field_access, [["." , e , :begin]], [["." , e , :end]] ]
else
[ [[ “.” , field_access , :get_value_ptr]],
[["->" , e , :begin]],
[["->" , e , :end]]
]
end
On Sat, Feb 28, 2009 at 03:54:01PM +0900, William J. wrote:
This tends to prove the hypothesis that Commune Lisp users are
incapable of becoming fluent in other languages. They lack the
ability to change and to grow; their minds seem to be fossilized.
They believe that the evolution of programming languages ended
with FORTRAN.
That’s a patently false stereotype, judging by my observations.
On Wed, Feb 25, 2009 at 05:22:35AM +0900, Glen F. Pankow wrote:
Impressive, young Skyparenthesizer. And here I thought Darth Java
had won the Clone/Dup/Bloat War.
No! Please stop. I can’t take any more… Please, before I die
laughing URGGHHHH
Jörg W Mittag wrote:
Signature object à la Python’s PEP362 “Function Signature Object”:
http://Python.Org/dev/peps/pep-0362/
… which will appear[1] in Ruby 1.9.2. Nice work!
jwm
[1] https://GitHub.Com/RubySpec/MatzRuby/blob/trunk/proc.c#L694-710
David M. wrote:
Charles Oliver N. wrote:
And now that ruby_parser can be used for almost all the offline
PT-based tools, there’s even less motivation.
Merb uses ParseTree for something called ActionArgs feature which, as I
understand it, actually relies on the name of function parameters. For
example, if you have an action which takes an argument called ‘foo’, and
that URL is hit with a querystring like ?foo=bar, it will pass that
value (‘bar’, in that case) as that argument.
Actually, this could be much better solved by a well-structured
Signature object à la Python’s PEP362 “Function Signature Object”:
http://Python.Org/dev/peps/pep-0362/
jwm
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs