Why the fast_* slots?

Jeremy @ Cowgar jeremy at cowgar.com
Fri Jul 31 19:01:32 UTC 2009


Hello Mildred,

  Most of the slots that I was looking at (ABSTRACT_STRING) simply did
  this:

  - fast_abc params <- ();
  - abc params <- ( fast_abc );

  i.e.  the  "non"  fast  simply called the fast_ slot. the "non" fast
  slots were just 1 line long, an example is:

  - fast_index_of ch:CHARACTER :INTEGER <-
  // Gives the index of the first occurrence `ch' or
  // 0 if none.
  (+ result:INTEGER;
    result := 1 + storage.fast_index_of (ch,0) until (count - 1);
    ? {(result != count + 1) ->> {item result = ch}};
    result
  );
  
  - index_of ch:CHARACTER :INTEGER <-
  // Gives the index of the first occurrence of 'ch' or
  // 0 if none.
  (
    fast_index_of ch
  );

  See how the "non" fast simply calls the "fast"?

Jeremy
mailto:jeremy at cowgar.com

============
Friday, July 31, 2009, 2:57:31 PM, you wrote:

> Hi,

> I think that generally the fast_ slots make comparisons using the =
> (identity) operator while the non fast slots use the == (equality)
> operator. That's the same difference between == and .equals(other) in
> Java. I saw this in DICTIONARY and SET

> Now, because CHARACTER is Expanded, the = and == operators have the same
> results, as a consequence the slots are the same.

> Now, I don't know why these slots are present, I suppose these slots may
> overwrite slots in generic parent prototypes.

> Mildred




More information about the Lisaac-devel mailing list