inherent features of Int

This commit is contained in:
aarne
2006-04-04 14:44:46 +00:00
parent c437f63404
commit a42a232c57
5 changed files with 136 additions and 45 deletions

View File

@@ -12,6 +12,31 @@ Changes in functionality since May 17, 2005, release of GF Version 2.2
</center>
<p>
3/4 (AR) The predefined abstract syntax type <tt>Int</tt> now has two
inherent parameters indicating its last digit and its size. The (hard-coded)
linearization type is
<pre>
{s : Str ; size : Predef.Ints 1 ; last : Predef.Ints 9}
</pre>
The <tt>size</tt> field has value <tt>1</tt> for integers greater than 9, and
value <tt>0</tt> for other integers (which are never negative). This parameter can
be used e.g. in calculating number agreement,
<pre>
Risala i = {s = i.s ++ table (Predef.Ints 1 * Predef.Ints 9) {
<0,1> => "risalah" ;
<0,2> => "risalatan" ;
<0,_> | <1,0> => "rasail" ;
_ => "risalah"
} ! <i.size,i.last>
} ;
</pre>
Notice that the table has to be typed explicitly for <tt>Ints k</tt>,
because type inference would otherwise return <tt>Int</tt> and therefore
fail to expand the table.
<p>
31/3 (AR) Added flags and options to some commands, to help generation: