/[eiffelstudio]/FreeELKS/trunk/library/kernel/type.e
ViewVC logotype

Contents of /FreeELKS/trunk/library/kernel/type.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91484 - (show annotations)
Thu Jan 25 00:11:12 2007 UTC (13 years ago) by manus_eiffel
File size: 1085 byte(s)
Added required class TYPE for the EiffelStudio compiler.
Added INTERNAL which is needed for the implementation of TYPE and ROUTINE in EiffelStudio.

1 indexing
2 description: "Representation of an Eiffel type."
3 library: "Free implementation of ELKS library"
4 copyright: "Copyright (c) 1986-2004, Eiffel Software and others"
5 license: "Eiffel Forum License v2 (see forum.txt)"
6 date: "$Date$"
7 revision: "$Revision$"
8
9 class
10 TYPE [G]
11
12 inherit
13 ANY
14 redefine
15 is_equal
16 end
17
18 create {NONE}
19
20 feature -- Comparison
21
22 is_equal (other: like Current): BOOLEAN is
23 -- Is `other' attached to an object considered
24 -- equal to current object?
25 local
26 l_internal: INTERNAL
27 do
28 create l_internal
29 Result := l_internal.generic_dynamic_type (Current, 1) =
30 l_internal.generic_dynamic_type (other, 1)
31 end
32
33 feature -- Conversion
34
35 adapt alias "[]" (g: G): G is
36 -- Adapts `g' or calls necessary conversion routine to adapt `g'
37 do
38 Result := g
39 ensure
40 adapted: equal (Result, g)
41 end
42
43 attempt alias "#?" (obj: ANY): G is
44 -- Result of assignment attempt of `obj' to entity of type G
45 do
46 Result ?= obj
47 ensure
48 assigned_or_void: Result = obj or Result = default_value
49 end
50
51 default_value: G is
52 do
53 end
54
55 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23