rfc: rdbms - new type system

Ulf Wiger (AL/EAB) ulf.wiger@REDACTED
Mon Feb 27 09:50:08 CET 2006


 
Romain Lenglet wrote:
>
> I am wondering if ASN.1 could be used here.
> If one is looking for a flexible abstract syntax notation 
> that allows to specify constraints, then ASN.1 seems to be 
> the canonical choice.

... but I'm not sure how many people know ASN.1. Most
people using mnesia/rdbms would probably want to describe
native erlang terms, whereas ASN.1 is primarily an encoding
specification.

Another possibility would be to reuse the match specification
syntax, a la ets:match_spec_run([Object], Pattern). If the
result is [], a type violation is raised.

The downside would be that enums and list types would be 
much more difficult (list types, near impossible) to specify.
Also, match specs are notoriously difficult to write.


> OTP's asn1 application already provides a parser for the 
> abstract syntax, and defines a canonical mapping into Erlang terms:
> http://www.erlang.org/doc/doc-5.4.12/lib/asn1-1.4.4.9/doc/html
> /asn1_ug.html#1.5
> 
> Aren't you re-inventing ASN.1? ;-)

Well, isn't everyone?  (:

/Uffe



More information about the erlang-questions mailing list