Re: database design method
Date: Fri, 15 Nov 2002 23:57:07 +0200
Message-ID: <3DD56DB3.21E45383_at_atbusiness.com>
Jan,
> So can I abuse you a little more as my tutorial-D tutor? :-) Can I have
> recursive types? For example (probably not the right syntax, but I think you
> will understand what I mean):
>
> TYPE Tree = TUPLE { NODE-VALUE STRING, SUBTREES RELATION { TREE Tree } }
just returning to this question. I did not find anything related to recursive
definitions
OPERATOR TRANCLO ( XY RELATION { X P#, Y P# } )
in TTM (www.thethirdmanifesto.com). However, here is an example of a recursive
operator expressed
in Tutorial-D (page 163, 2ed):
RETURNS RELATION { X P#, Y P# } ;
RETURN
WITH ( XY UNION ( ( XY COMPOSE
( XY RENAME ( Y AS Z, X AS Y ) ) )
RENAME Z AS Y ) ) AS TTT :
IF TTT = XY THEN TTT /* unwind recursion */
ELSE TRANCLO ( TTT ) /* recursive invocation */
END IF;
END OPERATOR;
Your Tutorial-D Tutor,
Lauri Pietarinen
Received on Fri Nov 15 2002 - 22:57:07 CET