Dhanapal
Dhanapal

Reputation: 14507

What programming language has this syntax?

I came across this statement as code, on a programming puzzle web site.

(i. >./) (0 >. +)/@:|.\ a

Wondering, what language has these type of syntax?

Upvotes: 2

Views: 792

Answers (4)

SadSido
SadSido

Reputation:

Perfectly valid c++ code. Just give me a couple of #define directives, and this cryptic code will print a "Mary has a little lamb"...

Just kidding, but why not? Preprocessor may translate almost anything into a valid code...

Upvotes: 0

paxdiablo
paxdiablo

Reputation: 881403

APL had that sort of syntax. Not that exact syntax but near the same level of readability. Did the web site not offer a clue?

Forth, as well, had similar syntax (R> . .@) but it still tended to have spaces between words, unlike your sample.

Update:

Actually, it does look like APL or a variant thereof. See this link here for the line:

(i. >./) z     NB. Hook. Linear index of pivot

The comments at the top of that file:

NB.  AMENDMENT:  "A Change for the Better"
NB.  Vector, vol. 9, No. 3 (January 1993) p.134-140. Used J Version 5
NB.  x i} m  Amend was amended in Version 4 and further amended
NB.  in J Release 2
NB.  Executes with J Release 2.05, March 1995

so it's the J variant of APL. See here if you want to enhance your migraines.

Upvotes: 0

swampsjohn
swampsjohn

Reputation: 7046

That's probably the J programming language. For example, here's a page that mentions the (i. >./) idiom

(I wanted to say Perl as a joke ;)

Upvotes: 10

Ryan Oberoi
Ryan Oberoi

Reputation: 14495

K has some really weird syntax. Also, on the list are APL, R and some other weird languages, which are pretty powerful for their purposes, and in some cases, use their own character set. My guess would be that this is closer to K than anything else.

Upvotes: 1

Related Questions