Page 1 of 1

WITH statement

Posted: Mon Sep 09, 2013 7:35 pm
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" ...     

Re: WITH statement

Posted: Tue Sep 10, 2013 8:22 am
by Dave
No, only expressions.

Re: WITH statement

Posted: Tue Sep 10, 2013 8:51 pm
by steved
:(
Are there any plans to include WITH statements in the future? It would be very nice.

thanks,
steve

Re: WITH statement

Posted: Wed Sep 11, 2013 8:38 pm
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.