Stateless and pure: Difference between revisions

From EiffelStudio: an EiffelSoftware project
Jump to navigation Jump to search
Manus (talk | contribs)
No edit summary
Manus (talk | contribs)
No edit summary
Line 1: Line 1:
[[Category:ECMA]]
[[Category:ECMA]]
Stateless can be syntactical or semantic. Semantic means that the feature does not refer to any state. Syntactical means that we annotate the routine with the equal sign so that this is visible to clients.
Proposal to have stateless routines to use the equal sign of constants, i.e.
Proposal to have stateless routines to use the equal sign of constants, i.e.



Revision as of 15:03, 29 June 2011


Stateless can be syntactical or semantic. Semantic means that the feature does not refer to any state. Syntactical means that we annotate the routine with the equal sign so that this is visible to clients.

Proposal to have stateless routines to use the equal sign of constants, i.e.

f (a: STRING): SOME_TYPE =
    do
        create Result.make (a)
        ...
    end

With some validity rules:

  • only unqualified calls to stateless features are permitted.

With some validity rules for redefinition:

  • once a routine is stateless its redefinitions have to be stateless.
  • a stateful routine can become stateless.