Re: Minimal language (was: registration and requests)

new topic     » topic index » view thread      » older message » newer message

From: Rob Craig

>Theoretically the following language, consisting of 4
>statements, will let you compute any mathematical
>function that you can compute in Euphoria, C++, or any
>other programming language. (Note that I/O is not considered,
>just computation.)

>1.   var = 0
>2.   var = var + 1
>3.   goto label
>4.   loop var times ... end loop

>Want to subtract? multiply? divide? remainder? You can do
>them all with loops and adding 1.

    Ooh, this is intriguing!  I see a couple of problems, though
it may just be my lack of eddykashun..

1.  No conditional or boolean testing would make a lot of
common mathematical functions impossible.  (geometry
springs immediately to mind, having to check relative positions
of points and for negativeness.)

2.  You specifically stated adding 1, but implied that there
could be no x = x + -1, meaning no negative numbers.

3.  Addition and multiplication are easy, but I can't figure out
subtraction or division, not without a conditional, negative
adding, or expressions allowed in the loop statement.  Please
give an example!

Thanks

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu