Skip to Content.
Sympa Menu

mathemagix-devel - [Mathemagix] Stricter syntax for glue

Subject: Mathemagix

List archive

[Mathemagix] Stricter syntax for glue


Chronological Thread 
  • From: Joris van der Hoeven <address@concealed>
  • To: address@concealed
  • Subject: [Mathemagix] Stricter syntax for glue
  • Date: Thu, 24 Sep 2009 15:51:04 +0200

Hi all,

In order to ensure compatibility with the upcoming compiler,
the glue syntax has been made slightly more strict.
The old syntax still works, but 'deprecated' warnings are issued.
The following changes have been made:

1) In function and variable definitions, the right-hand side must be a
literal.
This rule was most frequently violated for constructors and converters,
e.g.:

forall (C: Ring)
polynomial: Tuple C -> Polynomial C == polynomial C;

forall (C1: Ring, C2: Ring) assume (C2: Over C1)
convert: Polynomial C1 -> Polynomial C2 == as polynomial C2;

In these two cases, the new syntax becomes:

forall (C: Ring)
polynomial: Tuple C -> Polynomial C == keyword constructor;

forall (C1: Ring, C2: Ring) assume (C2: Over C1)
convert: Polynomial C1 -> Polynomial C2 == as;

All other violations should be removed by the introduction of suitable
macros.

2) In compound type declarations, the parameters on the right-hand side should
exactly match the parameters on the left hand side. A typical violation is:

class Quotient (C: Factorial_Ring) == quotient (C, C);

In order to comply to the new syntax, this now becomes:

cpp_preamble "#define simple_quotient(C) quotient<C,C >";
class Quotient (C: Factorial_Ring) == (cpp_macro simple_quotient) (C);

The new 'cpp_macro' primitive allows for parametric typedefs,
such as simple_quotient, using macro syntax. In other words,
we generate simple_quotient(integer) instead of simple_quotient<integer>.

The new syntax has been activated in most of the existing glue.
Nevertheless, some minor changes still have to be made in Bernard's glue.
Please do so sometime soon.

Best wishes, --Joris


  • [Mathemagix] Stricter syntax for glue, Joris van der Hoeven, 09/24/2009

Archive powered by MHonArc 2.6.18.

Top of Page