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

design of lambda type signatures

Name: Anonymous 2012-11-10 22:23

Hey /praha/, what do you guys look for in a lambda type signature?

I personally like to see their smile. No, i mean, homoiconicity and uniform definition and declaration.

Anyways, which would you rather use everyday?


function<int, int -> int> foo;

foo = [int a, int b -> int] {
  return a + b;
}


or perhaps


function<int | int, int> foo;

foo = [int | int, int] {
  return a + b;
}


or anything else? Comparisons to other languages would be appreciated.

Go-style: foo = [int a, int b] int { return a + b; }
Actionscript-style: foo = [a:int, b:int]:int { return a + b; }

Name: Anonymous 2012-11-13 22:15

Why not just use + (or wrap it in parentheses if necessary)? Languages are so verbose these days. Higher-level languages were supposed to be about doing more with less code, but a function that adds two integer parameters is shorter in most assembly languages!

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