leo icon indicating copy to clipboard operation
leo copied to clipboard

[Feature] Use a keyword to designate external functions?

Open acoglio opened this issue 1 year ago • 1 comments

There are currently two kinds of functions in Leo:

  • External functions, callable "from outside" (e.g. via input files), and designated via the @program annotation.
  • Internal functions, also called 'helper functions', callable only from within the program, and designated via the absence of the @program annotation.

Given that this is an important distinction, we could consider using a keyword like external to designate external functions. There is nothing wrong with using an annotation. This is just an idea.

acoglio avatar Aug 10 '22 18:08 acoglio

Based on today’s discussion with @d0cd: Related to this, we could also consider whether, instead of the @inline annotation, we could use an inline keyword instead. This property is more “internal” to the Leo compiler, instructing it to either inline a function or to map it to an Aleo closure, so perhaps an annotation might be appropriate after all.

acoglio avatar Aug 11 '22 20:08 acoglio

Closing this since this is the motivation for transition functions which exist in Leo v1.6.2.

collinc97 avatar Jan 05 '23 22:01 collinc97