mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2026-02-14 22:44:52 +01:00
merged from 19.05
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2228 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
[[Property:modification_date|Tue, 10 Sep 2019 21:54:55 GMT]]
|
||||
[[Property:publication_date|Tue, 10 Sep 2019 21:54:55 GMT]]
|
||||
[[Property:title|ET: Instructions]]
|
||||
[[Property:weight|-6]]
|
||||
[[Property:uuid|628bf3db-728f-0b3c-bdbb-fe52deaae5b7]]
|
||||
@@ -104,11 +106,7 @@ Here's one example:
|
||||
and the other:
|
||||
|
||||
<code>
|
||||
across
|
||||
my_list as ic
|
||||
loop
|
||||
print (ic.item)
|
||||
end
|
||||
across my_list as ic loop print (ic.item) end
|
||||
</code>
|
||||
''Loop example 2.''
|
||||
|
||||
@@ -117,14 +115,8 @@ At first observation, it may not appear that both of these examples are using th
|
||||
|
||||
Incidentally, there is no requirement that ''Loop example 1'' occupy multiple lines, and ''Loop example 2'' occupy only one line. ''Loop example 1'' could have been written like this:
|
||||
<code>
|
||||
from
|
||||
my_list.start
|
||||
until
|
||||
my_list.off
|
||||
loop
|
||||
print (my_list.item)
|
||||
my_list.forth
|
||||
end
|
||||
from my_list.start until my_list.off
|
||||
loop print (my_list.item) my_list.forth end
|
||||
</code>
|
||||
just as ''Loop example 2'' could have been written to take multiple lines. It comes down to a matter of balance among traditional style, conciseness, and readability.
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
[[Property:modification_date|Tue, 10 Sep 2019 23:07:44 GMT]]
|
||||
[[Property:publication_date|Tue, 10 Sep 2019 23:07:44 GMT]]
|
||||
[[Property:title|ET: Other Mechanisms]]
|
||||
[[Property:weight|-4]]
|
||||
[[Property:uuid|c0a01664-194c-4e84-0517-8e7c1ca61dec]]
|
||||
@@ -14,7 +16,7 @@ Sometimes we want to provide in software text a self-denoting value of a particu
|
||||
|
||||
In this case we used a manifest constant, <code>1</code>, to provide an initial value for <code>my_index</code>. In particular, this is a manifest integer.
|
||||
|
||||
Eiffel also supports [[Eiffel Programming Language Syntax#Manifest constants|manifest constants]] for real (and double) numbers (ex: <code>3.1415</code>), boolean values (ex: <code>True</code>, <code>False</code>), and characters (ex: <code>'A'</code>, with [[Eiffel programming language syntax#Special characters|special characters]] expressed using a percent sign as in <code>'%N'</code> for new line, <code>'%B'</code> for backspace, <code>'%"'</code> for double quote, and <code>'%U'</code> for null).
|
||||
Eiffel also supports [[Eiffel_programming_language_syntax#Manifest_constants|manifest constants]] for real (and double) numbers (ex: <code>3.1415</code>), boolean values (ex: <code>True</code>, <code>False</code>), and characters (ex: <code>'A'</code>, with [[Eiffel programming language syntax#Special characters|special characters]] expressed using a percent sign as in <code>'%N'</code> for new line, <code>'%B'</code> for backspace, <code>'%"'</code> for double quote, and <code>'%U'</code> for null).
|
||||
|
||||
Manifest constants are also available for strings, using double quotes as in: <code>"Hello world!"</code>. As with character constants, special characters are denoted using the <code>%</code> codes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user