Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Valid Symta Code

Name: Anonymous 2022-12-03 13:50

I have just noticed that Symta approaches the state where any combination of characters becomes a valid code:

For example,
<header> hello world </header>
Is a valid Symta expression.

No jokes! It is parsed as a SEXP "((`<` (`>_` header)) hello world (`<` (`/` (`>_` header))))":
https://imgur.com/a/8Oe3VBq

Name: Anonymous 2022-12-05 22:00

A scripting language which doesn't support command line and one-liners? Welcome to Python!

Symta
L{&~s+?} //sum elements of a list
//~x are implicitly created variables, which get returned

L{?[i~+]} //diagonal elements of matrix
//x~ are implicitly created variables, which don't get returned

L{&~s+?[i~+]} //sum diagonal elements elements of a matrix


Give the above
#Symta is a command line friendly expression-based language
say [1,2,3 4,5,6 7,8,9]{&~s+?[i~+]} // prints 15


Python
#Note that Python is a statement-based language,
#It requires explicit end of line after each statement.
#That makes command-line use and one-liners impossible,
#And also forces us to
#Split primitive operations across,
#Multiple,
#Lines
L=[[1,2,3],[4,5,6],[7,8,9]]
S=0
for i in range(len(L)): S+=L[i][i]
print S


I know Symta looks like APL, but it isn't, it is a LISP dialect, which add syntactic sugar and convenience utilities around (lambda (x) y). These auto-variables are basically a shorthand for closure, which persists across all lambda calls. I just found that optimizing the syntax towards processing lists with lambda results into really short code for almost all common tasks.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List