You may have thought of these before, but just for fun, here are
some ideas from a "minimal finger typing" programming language
that I was trying to make
for i < 5
foo
The {< 5} maps to Python's range(5). The < operator is unary here.
One could make {<= 5} map to either range(5+1) or range(1,5+1).
for i in 2..50
foo
a..b maps to Python's range(a,b), a...b maps to range(a, b+1).
Other cool things include having operators on functions do the
right thing:
# Python notation
f = (cos+sin)/(cos-sin) - cos**2
# Same as (cos(1.0)+sin(1.0))/(cos(1.0)-sin(1.0))-cos(1.0)**2
f(1.0)
mean = sum/len
And of course you can make +, *, xor, ||, && be unary operators.
Though spelling these out can make things more readable:
factorial (n) =
product(1...n)
Do you have any examples of Pluvo self modifying programs?
- Connelly Barnes
connelly barnes at gmail com
http://barnesc.blogspot.com/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com