/g/ - Technology

install openbsd

[Make a Post]
[X]





cancer language Nanonymous No.1078 [D][S][L][A][C] >>1100

So today I was fiddling around with my toy lisp-like implementation and I came up with this shitty program to add an arbitrary number of numbers together.

#! /usr/bin/env ns
<= n 1
<= l 1

<- "Enter number of numbers: "
<= nn [->]
>: [? [> [=> nn] 1] a [#!]]
<- "Number of numbers must be greater than one.\n"
>: e

<: a
<- "Enter number #" [=> n] ": "
<= [=> n] [->]
<= n [+ [=> n] 1]
>: [? [> [=> n] [=> nn]] c a]

<: c
<= r [=> [=> l]]
<: l
<= l [+ [=> l] 1]
<= r [+ [=> r] [=> [=> l]]]
>: [? [== [=> l] [- [=> n] 1]] f l]

<: f
<- "The result is " [=> r] "\n"

<: e
#! End of program

Tell me, is this pajeet shit, or it is white man's artwork?

Nanonymous No.1079 [D]

Formatting fucked up. Let's try indentation.

#! /usr/bin/env ns
<= n 1
<= l 1

<- "Enter number of numbers: "
<= nn [->]
>: [? [> [=> nn] 1] a [#!]]
<- "Number of numbers must be greater than one.\n"
>: e

<: a
<- "Enter number #" [=> n] ": "
<= [=> n] [->]
<= n [+ [=> n] 1]
>: [? [> [=> n] [=> nn]] c a]

<: c
<= r [=> [=> l]]
<: l
<= l [+ [=> l] 1]
<= r [+ [=> r] [=> [=> l]]]
>: [? [== [=> l] [- [=> n] 1]] f l]

<: f
<- "The result is " [=> r] "\n"

<: e
#! End of program

Nanonymous No.1082 [D] >>1085 >>1091

Sorry but Lisp is pure jewish intellectualism for the academic retards in their ivory towers.
Try SML or Ocaml if you want actual nice functional programming.
Or realize that functional programming as whole is a retarded idea that spawned a very limited number of useful concepts; map, reduce/fold, match.

Nanonymous No.1085 [D] >>1093

>>1082
i dunno, haskell is pretty cool. functional programming is less jewish than oop though. fact.

Nanonymous No.1091 [D]

>>1082
OOP is for pajeets and C++niggers. Real programmers program in brainfuck.

Nanonymous No.1093 [D] >>1095

>>1085
>Haskell is less jewish
The package manager is called "cabal" for God's sake.

Nanonymous No.1095 [D]

>>1093
I wonder, did some guy name it "cabal" because he saw some pun and the word happened to be a kike term, or did a kike name it that to promote his desert cult?
I'm leaning on #2.

Nanonymous No.1100 [D]

>>1078
>it's esolang implementation #28934238
if you replaced those cryptic command strings <= <- >: <: ? > and all that kind of shit with actual words, it would be way easier to read and program. but I do admit its cryptic nature gives it a pleasing appearance