You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whentrue:
templatetake*(a: untyped, max: int): untyped=type T =typeof(block: (for ai in a: ai))
var ret: seq[T]
var i =0if max >0:
for ai in a:
ret.add ai
i.inc
if i >= max: break
ret
note
we could also add takeExactly where we'd raise if we don't have enough elements
add this to sequtils:
Example
note
we could also add
takeExactly
where we'd raise if we don't have enough elementsother languages
The text was updated successfully, but these errors were encountered: