orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
41 stars 3 forks source link

Add new keyword for def type information #99

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Jay has requested a change in syntax to help differentiate a defined function's 
type signature from its actual body definition.

The keyword 'sig' has been proposed to replace 'def' in this context.

For example,

def id[A](A) :: A
def id(x) = x

would become

sig id[A](A) :: A
def id(x) = x

Original issue reported on code.google.com by dkitc...@gmail.com on 24 Feb 2012 at 2:55

GoogleCodeExporter commented 9 years ago
(just cleaning up -- accepting "New" issues)

Original comment by jthywissen on 6 Jul 2012 at 9:59

GoogleCodeExporter commented 9 years ago

Original comment by jthywissen on 20 Jan 2013 at 4:09

arthurp commented 7 years ago

Looking back at this after some time, I'm not sure I actually think this is a good idea. We should discuss.

jthywiss commented 7 years ago

Agree. I'm leaning towards the existing syntax because

def id[A](A) :: A
def id(x) = x

and

def id[A](A) :: A = x

mean the same thing, and the exiting syntax seems to imply that more strongly than syntax with a different keyword (such as sig) on the type declarations.