mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-06 14:52:03 +01:00
Author:halw
Date:2008-12-19T15:39:13.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@142 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -22,15 +22,15 @@ Eiffel for .NET supports:
|
||||
|
||||
The following syntax can be used to declare .NET custom attributes on Eiffel entities (features and classes):
|
||||
<code>
|
||||
empty: BOOLEAN is
|
||||
indexing
|
||||
description: "Is Current empty?"
|
||||
attribute: create {OBSOLETE_ATTRIBUTE}.make_obsoleteattribute_1 ("Use `is_empty' instead") end
|
||||
obsolete
|
||||
"Use is_empty instead"
|
||||
do
|
||||
Result := is_empty
|
||||
end
|
||||
empty: BOOLEAN
|
||||
indexing
|
||||
description: "Is Current empty?"
|
||||
attribute: create {OBSOLETE_ATTRIBUTE}.make_obsoleteattribute_1 ("Use `is_empty' instead") end
|
||||
obsolete
|
||||
"Use is_empty instead"
|
||||
do
|
||||
Result := is_empty
|
||||
end
|
||||
</code>
|
||||
|
||||
The previous example shows the declaration of the obsolete feature <code> empty </code> . The custom attribute defined by <code> OBSOLETE_ATTRIBUTE </code> is used to ensure that any consumer of the resulting assembly will see the feature as being obsolete. The custom attribute is defined in the indexing clause <code> attribute </code>. The definition consists of a creation expression that creates the custom attribute with the right parameters.
|
||||
@@ -48,14 +48,14 @@ Another advantage of Eiffel for .NET's implementation of covariance is that it c
|
||||
===Genericity===
|
||||
|
||||
The CLR does not support generics at all, so that the following Eiffel for .NET classes:
|
||||
* <code> LIST [ANY] </code>
|
||||
* <code> LIST [INTEGER] </code>
|
||||
* <code>LIST [ANY]</code>
|
||||
* <code>LIST [INTEGER]</code>
|
||||
|
||||
will actually be generated as:
|
||||
* <code> LIST_ANY </code>
|
||||
* <code> LIST_Int32 </code>
|
||||
* <code>LIST_ANY</code>
|
||||
* <code>LIST_Int32</code>
|
||||
|
||||
Meaning that if one wants to reuse an Eiffel generic class from another language than Eiffel for .NET, one has to use either <code> LIST_ANY </code> or <code> LIST_Int32 </code>.
|
||||
Meaning that if one wants to reuse an Eiffel generic class from another language than Eiffel for .NET, one has to use either <code>LIST_ANY</code> or <code>LIST_Int32</code>.
|
||||
|
||||
===Enum types===
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[[Property:uuid|78c6b5c1-a87b-805d-38bd-fe64cb4e7c0d]]
|
||||
==Eiffel issues==
|
||||
* Check here first for the [[Eiffel for .NET Limitations|Difference between Eiffel and Eiffel for .NET]] .
|
||||
* The root creation routine of the root class must not take any arguments. You can access the command line given to the application via the class <code> ARGUMENTS. </code>
|
||||
* The root creation routine of the root class must not take any arguments. You can access the command line given to the application via the class <code>ARGUMENTS</code>.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,15 @@ When the display is finished, the application wait for you to pressed the return
|
||||
|
||||
==Under the Hood==
|
||||
|
||||
This application shows how to interact with a database. First the connection to the database is open ( <code> create </code> <code> my_sql_connection </code>. <eiffel>make_from_connection_string </eiffel> ( ''my_database'')), then a request to the database is made (create my_sql_command. <eiffel>make_from_cmd_text_and_connection </eiffel>( ''my_command'', <code> my_sql_connection </code>)). Finally, the result of the request is displayed.
|
||||
This application shows how to interact with a database. First the connection to the database is opened:
|
||||
<code>
|
||||
create my_sql_connection.make_from_connection_string (my_database)
|
||||
</code>
|
||||
Then a request to the database is made:
|
||||
<code>
|
||||
create my_sql_command.make_from_cmd_text_and_connection (my_command, my_sql_connection)
|
||||
</code>
|
||||
Finally, the result of the request is displayed.
|
||||
|
||||
This sample contains the following class:
|
||||
* <eiffel>SQL_DATA_READER</eiffel>
|
||||
|
||||
@@ -37,11 +37,11 @@ Allowable operations are:
|
||||
Enter a number, followed by :
|
||||
</code>
|
||||
|
||||
Enter the first number to be put onto the stack, for example <code> 3 </code>.
|
||||
Enter the first number to be put onto the stack, for example <code>3</code>.
|
||||
|
||||
'''Note:''' Failing to enter a number at this stage will cause the sample to stop. This sample was designed to showcase the use of EiffelBase data structures and is not protected against unexpected entries.
|
||||
{{note|Failing to enter a number at this stage will cause the sample to stop. This sample was designed to showcase the use of EiffelBase data structures in the Microsoft .NET environment and is not protected against unexpected entries. }}
|
||||
|
||||
You may then add another number on the stack by entering the character <code> a </code>:
|
||||
You may then add another number on the stack by entering the character "<code>a</code>":
|
||||
<code>
|
||||
*********************************
|
||||
Calculator in reverse Polish form
|
||||
@@ -63,7 +63,7 @@ Next operation? a
|
||||
Enter a number, followed by :
|
||||
</code>
|
||||
|
||||
Enter a second number, for example <code> 2 </code>. You can then apply any operation to the two operands such as minus:
|
||||
Enter a second number, for example <code>2</code>. You can then apply any operation to the two operands such as minus:
|
||||
<code>
|
||||
...
|
||||
Next operation? a
|
||||
@@ -78,9 +78,9 @@ Accumulator = 1
|
||||
Next operation?
|
||||
</code>
|
||||
|
||||
You may use the operation <code> 0 </code> to clear the stack at any time. You may use <code> q </code> to quit the program.
|
||||
You may use the operation<code> 0</code> to clear the stack at any time. You may use <code>q</code> to quit the program.
|
||||
|
||||
{{tip|You can use the command <code> ? </code> to display the list of available operations. }}
|
||||
{{tip|You can use the command <code>?</code> to display the list of available operations. }}
|
||||
|
||||
==Under the Hood==
|
||||
|
||||
|
||||
@@ -28,7 +28,17 @@ When the display is finished, the application wait for you to pressed the return
|
||||
|
||||
==Under the Hood==
|
||||
|
||||
This application shows how to use the thread <eiffel>THREAD_POOL</eiffel>. An asynchronous thread is launched ( <code> feature </code> { <eiffel>THREAD_POOL</eiffel>}. <eiffel>queue_user_work_item_wait_callback_object</eiffel>( <code> create </code> { <eiffel>WAIT_CALLBACK</eiffel>}. <eiffel>make</eiffel> ( <code> Current </code>, $ <eiffel>my_async_operation</eiffel>), <code> l_async_operation_done </code>)) and is associated to the local variable <code> l_async_operation_done. </code>Both threads perform simultaneously some operations. The main thread wait for the asynchronous thread to complete his own operations ( <code> l_async_operation_done </code>. <eiffel>wait_one</eiffel>) to close the application.
|
||||
This application shows how to use the thread <eiffel>THREAD_POOL</eiffel>.
|
||||
An asynchronous thread is launched:
|
||||
<code>
|
||||
feature {THREAD_POOL}.queue_user_work_item_wait_callback_object
|
||||
(create {WAIT_CALLBACK}.make (Current, $my_async_operation, l_async_operation_done))
|
||||
</code>
|
||||
and is associated to the local variable <code>l_async_operation_done</code>. Both threads perform simultaneously some operations. The main thread wait for the asynchronous thread to complete his own operations
|
||||
<code>
|
||||
l_async_operation_done.wait_one
|
||||
</code> to close the application.
|
||||
|
||||
|
||||
This sample contains the following class:
|
||||
* <eiffel>THREAD_POOL</eiffel>
|
||||
|
||||
@@ -32,7 +32,11 @@ When the display is finished, the application wait for you to pressed the return
|
||||
|
||||
==Under the Hood==
|
||||
|
||||
This application shows how to use the thread <eiffel>TIMER</eiffel>. The timer is launched ( <code> create </code> <code> my_timer </code>. <eiffel>make_with_callback</eiffel> ( <code> create </code> { <eiffel>TIMER_CALLBACK</eiffel>}. <eiffel>make</eiffel> (Current, $ <eiffel>check_status</eiffel>), Void, 0, 2000)) and call the feature <eiffel>check_status</eiffel> that displays the message <code> "Checking Status." </code> every two seconds.
|
||||
This application shows how to use the thread <eiffel>TIMER</eiffel>. The timer is launched:
|
||||
<code>
|
||||
create my_timer </code>.make_with_callback (create {TIMER_CALLBACK}.make (Current, $check_status), Void, 0, 2000)
|
||||
</code>
|
||||
and call the feature <eiffel>check_status</eiffel> that displays the message <code> "Checking Status." </code> every two seconds.
|
||||
|
||||
This sample contains the following class:
|
||||
* <eiffel>TIMER</eiffel>
|
||||
|
||||
Reference in New Issue
Block a user