Yoda programming language
Trezker

I just set here programming and suddenly I inversed the order of a return so it became "x return;" instead of "return x;"

So the thought struck me that a Yoda programming language would be a fun addition to the likes of chef, shakespeare etc...

Of course I'm not the first guy to think of this. A microsoft emplyoee apparently took some time off blogging about getting this idea. But he didn't go very deep, and I would like to argue that his example sucks. http://blogs.msdn.com/mattwar/archive/2005/10/09/479008.aspx

So I'm wondering if the members of this community can do better.

if imaginative you are
example make you must

Matthew Leverton

Perl seems to do everything backward to me. Maybe it is the Yoda language?

Neil Black

I'm still waiting on the Chewbacca programming language:

BBWWAAAA!!!("Hello World");

Thomas Fjellstrom
Quote:

Perl seems to do everything backward to me. Maybe it is the Yoda language?

I think you're thinking of Forth :)

alethiophile

It wouldn't be hard to write a grammar alterer with lex/yacc that takes some-language-with-reversed-words and returns that-language-correct.

Kibiz0r

But how would you do exception handling, since there is no try?

Erikster
Kibiz0r said:

But how would you do exception handling, since there is no try?

Dang, beat me to it.

Trezker
do?
{
    codestuff
}
did not(reason)
{
    speak(reason);
}

Arthur Kalliokoski

Doesn't Polish notation (for calculators) fit the bill?

Otherwise, if this Yoda language took off, there wouldn't be a need for allegro.cc to aid beginners, since "There is no try, there is only do!"

Cody Harris

Yoda does not need to worry about exceptions, his code is infallible.

alethiophile
(do||!do)
!try

;)

ReyBrujo

Perl does something similar:

print "Hello World!" if ($test == 1);

Thomas Fjellstrom

print "Hello World!\n" unless not $test;
;)

ixilom
Neil Black said:

BBWWAAAA!!!("Hello World");

haha, that made me laugh and its only 9.30 am, good job :P

Gr4|\|f

But luke, not ready are you.

if (!ready)
{
     throw(jedi['luke']);
}

;)

alethiophile
question = (2b||!2b)

8-)

Gr4|\|f
Quote:

question = (2b||!2b)

No, that's already the question, you don't have to set it.

question == (2b||!2b)

alethiophile

No, but you're stating that "that is the question", you're not asking "Is that the question?"

Trezker
that=(2b||!2b)?question:!question;

Thread #597089. Printed from Allegro.cc