- 15-complex:
- operárotok (infix/bináris, prefix/unáris, szabad régen: @, #, |, &)
- create és !!
- once routine
- mi lenne, ha
COMPLEX
kifejtett (expanded) típus lenne?
- új szintaxis "szabad operátorokra" (csak alias)
- assign
- matrix: assign, bracket
- 16-complex:
- deferred
- programkönyvtárból öröklés
- external
- több feature-klóz (megjegyzések!)
- "védett" láthatóság
- frozen
- példányosítás megadott típussal
(
!!
és create
),
- matematikai műveletek és
~=
a SmartEiffelben
- 17-complex/traditional:
Öröklés során újradeklarálás, definiálás (effektívvé tétel), újradefiniálás
class COMPLEX
infix "*" ( other: COMPLEX ) : COMPLEX deferred end
class POLAR_COMPLEX
< infix "*" ( other: COMPLEX ) : COMPLEX
---
> infix "*" ( other: COMPLEX ) : POLAR_COMPLEX
< create {POLAR_COMPLEX} Result.from_polar(r*other.r, arg+other.arg)
---
> create Result.from_polar(r*other.r, arg+other.arg)
- Újradeklarálás?
public class C implements Cloneable {
/** Shallow copy. It is safe to inherit, it respects dynamic type. */
public C clone(){
try { return (C) super.clone(); }
catch( CloneNotSupportedException e ){
assert false;
return null;
}
}
}
- 17-complex/eiffel: kapcsolt (anchored) típus
class COMPLEX
< infix "*" ( other: COMPLEX ) : COMPLEX deferred end
---
> infix "*" ( other: COMPLEX ) : like Current deferred end
class POLAR_COMPLEX
< infix "*" ( other: COMPLEX ) : POLAR_COMPLEX
---
> infix "*" ( other: COMPLEX ) : like Current