[wg-camlp4] Negative field report: extension points unsuited for (matches p when e)

Leo White lpw25 at cam.ac.uk
Tue May 14 17:35:32 BST 2013

>>> Possible syntaxes:
>>>   [%sh (seq: Line.present); (source: Line.present)]
>> This won't work, because you need to be able to replace Line.present
>> with an arbitrary type expression.
> Well, it would work with this syntax, wouldn't it?

You're right. I did not read the example closely enough.

>> This doesn't make it clear that "< seq: Line.present; source:
>> Line.present >" is not actually an object type, but an argument to the
>> sh extension.
> From a superficial reading, it seems that this is really an object type, where some fields are implicit.

Probably, I haven't looked at it too closely, but my point was that 

  < seq: Line.present; source: Line.present > 

was not being used as the object type 

  < seq: Line.present; source: Line.present >

but as an argument to an extension (which happens to produce a
*different* object type).

> We should probably wait for more widely used examples of extensions which would benefit from "type expressions" as
> arguments.  Of course, it's always possible to write:
>   [%sh ((): type_expr)]

Fair enough, although there is an argument that such extensions will not be
written if the syntax doesn't support them well.

More information about the wg-camlp4 mailing list