merged 18.07 into trunk

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2102 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2018-12-03 10:15:23 +00:00
parent 8a52104c2a
commit 8c687ec4a5
18 changed files with 1073 additions and 860 deletions

View File

@@ -1,3 +1,5 @@
[[Property:modification_date|Mon, 03 Dec 2018 10:00:43 GMT]]
[[Property:publication_date|Tue, 30 Oct 2018 14:56:21 GMT]]
[[Property:uuid|0CD0A1B2-42F8-48E0-B419-61B4DC076C1B]]
[[Property:weight|2]]
[[Property:title|Eiffel Coding Standard]]
@@ -27,7 +29,7 @@ create
feature {NONE} -- Initialization
make (a: INTEGER)
-- Initialize Current with `a'.
-- Initialize Current with `a`.
do
end
@@ -48,7 +50,7 @@ end</e>
If expressions are very long, break them on conjunctions as in:
<e>if
expr1 or else
expr1 and then
expr2
then
...
@@ -80,7 +82,10 @@ else
...
end</e>
* For punctuation, we always have a space before '''(''' and a space after ''')''', ''',''', ''':''', or ''';''':
* For punctuation, we always have
** a space before, and no after `(`
** no space before, and space after `)` `,` `:` or `;`
<e>require
a_tag: query (a, b, c) or other_query (c, d)
local

View File

@@ -1,3 +1,5 @@
[[Property:modification_date|Thu, 22 Nov 2018 19:50:45 GMT]]
[[Property:publication_date|Thu, 22 Nov 2018 19:50:45 GMT]]
[[Property:title|Example: Command line arguments]]
[[Property:weight|0]]
[[Property:uuid|ba852d83-3c02-4d38-088a-60b76fe5c63f]]
@@ -61,3 +63,6 @@ Command line argument value for option 'h' is: gamma
</code>
{{SeeAlso|[[Execution_profiles|How to run with arguments]]}}

View File

@@ -1,3 +1,5 @@
[[Property:modification_date|Mon, 10 Sep 2018 09:10:34 GMT]]
[[Property:publication_date|Mon, 10 Sep 2018 09:10:34 GMT]]
[[Property:title|Introduction to the Examples Book]]
[[Property:weight|-1]]
[[Property:uuid|044fa742-f3ca-9f5b-01cc-7194ee172b08]]
@@ -6,7 +8,7 @@ EiffelStudio comes with a rich set of examples that you can use to learn how to
The examples in this book are somewhat different in nature and serve a different purpose.
Although some of the examples included here are provided by Eiffel Software, the intent is that the majority of the entries will contributed by people like you who use Eiffel daily to solve real problems.
Although some of the examples included here are provided by Eiffel Software, the intent is that the majority of the entries will be contributed by people like you who use Eiffel daily to solve real problems.
The inspiration for this book is the many ''program chrestomathies'' on the World-Wide Web. In natural language, a chrestomathy is a set of literary passages explicitly selected for the purpose of helping learn a language. A program chrestomathy is a set of problems for which solutions are represented in various programming languages with the aim of allowing programmers to compare language capabilities and programming techniques.
@@ -14,7 +16,7 @@ Program chrestomathies vary widely. At one end of the spectrum [http://99-bottle
Eiffel has a presence on many of these sites. Still, the more examples, the better.
The purpose of the examples in this book, then, is two-fold. First, we get a set of Eiffel examples in the Eiffel online documentation with solutions to a different set of problems than the examples distributed with EiffelStudio. Second, examples from this set can be migrated to Rosetta Code or one of the other chrestomathies to improve Eiffel's presence on those sites. (The caveat to contributors is clear: '''Contribute only work that you have to authority to release, and only if you are willing to have your work shared on one or more of the program chrestomathies.''' By submitting content to this Examples book, you agree to release that content under terms no more restrictive than the GNU Free Documentation License.)
The purpose of the examples in this book, then, is two-fold. First, we get a set of Eiffel examples in the Eiffel online documentation with solutions to a different set of problems than the examples distributed with EiffelStudio. Second, examples from this set can be migrated to Rosetta Code or one of the other chrestomathies to improve Eiffel's presence on those sites. (The caveat to contributors is clear: '''Contribute only work that you have the authority to release, and only if you are willing to have your work shared on one or more of the program chrestomathies.''' By submitting content to this Examples book, you agree to release that content under terms no more restrictive than the GNU Free Documentation License.)
Sites like Rosetta Code and [http://en.literateprograms.org/LiteratePrograms:Welcome Literate Programs] offer a wide variety of programming problems or tasks for comparison of languages and techniques. Rosetta Code provides an index to the [http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_Eiffel tasks not yet implemented in Eiffel].

View File

@@ -1,15 +1,17 @@
[[Property:modification_date|Mon, 10 Sep 2018 09:09:25 GMT]]
[[Property:publication_date|Mon, 10 Sep 2018 09:09:25 GMT]]
[[Property:uuid|B74D374E-895C-4F22-B95F-656BD78ECD03]]
[[Property:weight|1000]]
[[Property:title|Getting a STRING from a NUMERIC object]]
[[Property:link_title|NUMERIC to STRING]]
Every class has the <code>out</code> method that can be used to get a text version of the object. For a lot of class, this method return internal informations that are not really useful for the end user. But for every <code>NUMERIC</code> class, the <code>out</code> method return a text representation of the number that the <code>NUMERIC</code> object represents.
Every class has the `out` method that can be used to get a text version of the object. For a lot of classes, this method returns internal information that is not really useful for the end user. But for every `NUMERIC` class, the `out` method returns a text representation of the number that the `NUMERIC` object represents.
<code>
print_integer(a_integer:INTEGER)
-- Print the value of `a_integer'
print_integer (a_integer: INTEGER)
-- Print the value of `a_integer`.
do
print(a_integer.out + "%N")
print (a_integer.out + "%N")
end
</code>
Note that for more advance convertion, you can also used convertion class like <code>FORMAT_DOUBLE</code>.
Note that for more advanced conversion, you can also use a conversion class like `FORMAT_DOUBLE`.

View File

@@ -1,13 +1,13 @@
[[Property:modification_date|Fri, 07 Sep 2018 12:13:00 GMT]]
[[Property:modification_date|Mon, 10 Sep 2018 09:06:41 GMT]]
[[Property:publication_date|Fri, 07 Sep 2018 12:13:00 GMT]]
[[Property:uuid|78393BBA-9B1E-4523-9881-3D83CEB6A952]]
[[Property:weight|3000]]
[[Property:title|Removing object while iterating on a LIST]]
If you already have the object that you want to remove from the `LIST` you can easily use `prune` and `prune_all`. But if you want to remove objects while iterating on that `LIST`, depending on criteria on the objects contained in the `LIST`, here what you can do.
If you already have the object that you want to remove from the `LIST` you can easily use `prune` and `prune_all`. But if you want to remove objects while iterating on that `LIST`, depending on criteria on the objects contained in the `LIST`, here is what you can do.
First of all, if you think about removing an object while iterating, I do not recommend using an `across` loop. If you iterate on the list using a `from until loop end`, just remember to use the `LIST.forth` only when you do not use `LIST.remove`.
For example, let's say we have class `MY_CLASS` with an attribute `has_stopped` and that I want to remove every object of a `LIST` that has this attribute set to `True`. Here what the code will look like.
For example, let's say we have class `MY_CLASS` with an attribute `has_stopped` and that I want to remove every object of a `LIST` that has this attribute set to `True`. Here is what the code will look like.
<code>
removing_stopped (a_list: LIST [MY_CLASS])

View File

@@ -1,7 +1,10 @@
[[Property:modification_date|Mon, 10 Sep 2018 09:04:15 GMT]]
[[Property:publication_date|Mon, 10 Sep 2018 09:04:15 GMT]]
[[Property:link_title|Mini How-tos]]
[[Property:uuid|B2E4622A-2495-47DD-9C02-B9940A026EC1]]
[[Property:weight|0]]
[[Property:title|Mini How-tos]]
In this section, you will find little how-tos that can be used to know how to used some very specific mechanics in Eiffel. Those how-tos are small by design and can be used to show very fundamental mechanisms for beginners or more advance mechanisms.
In this section, you will find little how-tos that you can use to learn some very specific mechanics in Eiffel. Those how-tos are small by design and can be used to show very fundamental, or more advanced, mechanisms for beginners.