[tmql-wg] Re: [topicmapmail] AsTMa! as TMCL

Robert Barta rho@bigpond.net.au
Sat, 14 Dec 2002 12:50:42 +1000


On Fri, Dec 13, 2002 at 09:51:35AM +0000, Kal Ahmed wrote:
> On Thursday 12 December 2002 17:15, Lars Marius Garshol wrote:
> > OSL doesn't have this problem, because it doesn't have regular
> > expressions at all. :-)
> >
> 
> I can see a couple of useful "usecases" for regex constraints on string values 
> such as resourceData and baseNameString, such as validating that a 
> "sort-name" variant is actually in the expected normalized form, or that a 
> "postcode" occurrence is in the expected form etc. I guess that the 
> discussion on regex constraints goes hand-in-hand with the discussion on 
> datatype constraints...

Very good point. With introducing regexps AsTMa! steals itself out of the
discussion about data types altogether. I find it a snake pit and staying
on a text level can buy some time.

What I can imagine is that implementations can use 'callbacks' such as in

forall $a [ * (address) ]                    # forall topics which are addresses
  => exists $a [ oc (zipcode) : ?is_zip ]    # there must be a zipcode occurrence,
                                             # and a user-defined function will check that

Cheap and it can help implementations of AsTMa! to distinguish themselves.

\rho