Clean up some of trans using block combinators

`with_scope` and `with_cond` can be used to wrap a piece of code in a
scope block, or conditionalize it on a value, without doing all the
context-creation and jumping by hand.

Also renames @block_ctxt to block to reduce noise.
This commit is contained in:
Marijn Haverbeke
2012-02-17 13:17:40 +01:00
parent 1c1261bcb8
commit ff42964546
12 changed files with 782 additions and 898 deletions

View File

@@ -186,11 +186,8 @@ pure fn head<T: copy>(v: [const T]) : is_not_empty(v) -> T { ret v[0]; }
Function: tail
Returns all but the first element of a vector
Predicates:
<is_not_empty> (v)
*/
fn tail<T: copy>(v: [const T]) : is_not_empty(v) -> [T] {
fn tail<T: copy>(v: [const T]) -> [T] {
ret slice(v, 1u, len(v));
}