On 28/12/2012, at 4:50 AM, Dobes Vandermeer wrote:
>
> It seems like you end up programming in a sort of "stack machine" mode, or
> similar.
Forth uses that model.
>
> I don't think a purely concatenative language would be friendly enough;
I agree, in fact, I know because category theory uses it.
Just for fun: my courses at UQ the math school used
reverse polish:
x sin
but then when I did stuff at USYD they used forward polish
sin x
which made exams a real challenge :)
However much programming is already like that:
read x;
print x;
do something;
is effectively lazy evaluation with continuations passed from
each operation to the next implicitly. Syntactically this is concatenative.
Now here's the thing: in Felix you can more or less convert:
x . f . g . h . k
this is reverse polish left associative applicative code. but this:
x . (f . g . h . k)
is a single reverse application with the functions concatenated in point
free style. If we want to go "whole hog":
{x} . f
is purely concatenative: { x } is value x lifted to a function. So you can also
drop a function k:1 -> T to a value:
k ()
or just
#k
So in Felix you can switch in and out of point free notation.
The "cost" is that in
f . g
the operator . is reverse function composition. Unfortunate, gives
it two meanings.
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language