WITH statement

This forum is for any questions about the language Tutorial D or the Rel implementation of it.
Post Reply
steved
Posts: 49
Joined: Sun Sep 01, 2013 10:53 pm

WITH statement

Post by steved »

Do WITH clauses support statements as well as expressions?
thanks,
steve

VAR T1 BASE RELATION {X INTEGER,Y INTEGER}KEY{X};

WITH(A:=RELATION{TUPLE{X 1,Y 1}}) : T1:= A ;

ERROR: Encountered "WITH" at line 1, column 1.
Was expecting one of:
"ANNOUNCE" ...
"BEGIN" ...
"CALL" ...     
"CASE" ...     
"COMMIT" ...     
"CONSTRAINT" ...     
"DO" ...     
"DROP" ...     
"EXECUTE" ...     
"FOR" ...     
"IF" ...     
"LEAVE" ...     
"LOAD" ...     
"OPERATOR" ...     
"OUTPUT" ...     
"RETURN" ...     
"ROLLBACK" ...     
"SET" ...     
"TYPE" ...     
"VAR" ...     
"WHILE" ...     
"WRITE" ...     
"WRITELN" ...     
<IDENTIFIER> ...     
<IDENTIFIER> ...     
"BEGIN" ...     
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: WITH statement

Post by Dave »

No, only expressions.
steved
Posts: 49
Joined: Sun Sep 01, 2013 10:53 pm

Re: WITH statement

Post by steved »

:(
Are there any plans to include WITH statements in the future? It would be very nice.

thanks,
steve
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: WITH statement

Post by Dave »

It was included in an earlier definition of Tutorial D, and was therefore implemented in some earlier versions of Rel. If I recall correctly, it was removed from Tutorial D because a complex statement can trivially be simplified by converting it to multiple statements.
Post Reply