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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user