[Cfp-interest] ON keyword notation - yet another syntactic variant

David Hough CFP pcfp at oakapple.net
Mon Jul 28 16:27:18 PDT 2014


ON syntax

macros don't work, pragmas don't work, try/catch don't work, 
attributes don't work... meaning that a majority or the C committee have
bad feelings about them.

How about an ON exception syntax?     At least it's a keyword.
I'd suggest allowing it whenever one of our #pragmas is allowed.

{
#pragma STDC PROPERTY value

code
}

becomes

{
ON exceplist action value

code
}

The most important action value pairs would be

fe_default
fe_abrupt				# underflow only
fe_substitute expression		# presubstitution
fe_immediate label			# goto label
fe_deferred label			# goto label

Another way to slice it would be to combine "on" and "action"
into a number of keywords

fe_default
fe_abrupt
fe_substitute
fe_immediate
fe_deferred

e.g.

{
fe_immediate exceplist label

code
}

Since it's not a pragma it's clear that it's mandatory rather than
permissive.

It could also be formulated in function or macro syntax but since
it's not really a function or macro, I don't see that it buys anything.
But maybe others would see it differently:

{
fe_immediate(exceplist,label);

code
}




More information about the Cfp-interest mailing list