Author:halw
Date:2010-05-27T15:25:42.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@624 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
halw
2010-05-27 15:25:42 +00:00
parent 51b5db4ac1
commit 9f49b377e5

View File

@@ -163,7 +163,7 @@ So in this simple form, <code>attached x</code> can be used instead of <code>x /
There is a code pattern for functions that exists in some Eiffel software to effect "once-per-object / lazy evaluation".
{{note|As of EiffelStudio version 6.6, the use of the attached syntax for effecting "once per object" is no longer necessary. V6.6 includes explicit support for <code>once</code> routines which can be adjusted by a [[ET: Other Mechanisms#Adjusting once semantics with "once keys"|once key]] to specify once per object.}}
{{note|As of EiffelStudio version 6.6, the use of this code pattern effecting "once per object" is no longer necessary. V6.6 includes explicit support for <code>once</code> routines which can be adjusted by a [[ET: Other Mechanisms#Adjusting once semantics with "once keys"|once key]] to specify once per object.}}
This "once-per-object" code pattern employs a cached value for some object which is not exported. When it is applied, the "once-per-object" function checks the attachment status of the cached value. If the cached value is void, then it is created and assigned to <code>Result</code>. If the cached value was found already to exist, then it is just assigned to <code>Result</code>.