I guess I am in my ivory tower but really if I am going to create a language/dialect which I ENJOY coding in day in/day out I am not worried about backward compatibility and or what people are used to - I am worried about what makes things consistent and beautiful. The obvious choice for the most consistent approach would be straight s-expressions but there is something to be said for the readability of declaration and assignment. My approach is basically s expressions with out the initial brackets i.e.
#LET
$x = func arg:val arg1:val2 arg2:(func1 arga:vara);
#s-expr
(setf x (func arg:val arg1:var arg2:(func1 arga:vara)));
Now I can fully see how the s-expression is more perfectly recursively consistent but I personally find the prior approach more readable and for "in the main" programming it would be the most maintainable.
Something I have been toying with is the idea of how to transmogrify dynamic function calls in s-expressions:
$decide = [$char | $char == a ? sum : mul];
$num = 10;
$letter = a;
$result = ($decide char:$letter) 6 6 ($num + 50);
#should become
$result = sum 6 6 ($num + 50);
#which becomes
$result = sum(6,6,($num + 50));
No comments:
Post a Comment