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

Curl programming language

Name: Anonymous 2010-06-06 11:12

Hey /prog/,

have you done anything in Curl (http://en.wikipedia.org/wiki/Curl_%28programming_language%29)? If so, is it any good? It looks kind of Lispy, and is attached to an apparently pretty decent RIA platform.

For those who have never heard of it, here's, some variations of factorial as code samples:

{define-proc {factorial n}
    {return {if n < 2
             then 1
             else n * {factorial (n - 1)}}}}

{define-proc {factorial n}
    {let result = 1}
    {for i = 2 to n do
        {set result = i * result}}
    {return result}}

{define-proc {factorial n}
    {let loop = {proc {acc, n}
                    {return {if n < 2
                             then acc
                             else {loop acc * n, n - 1}}}}}
    {return {loop 1, n}}}

Name: Anonymous 2010-06-06 22:34

They could have at least used square brackets, which don't require the shift key to type on non-gay keyboard layouts.

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