From 44c5adaad727f12cdf747ea6ccd12761967ebd66 Mon Sep 17 00:00:00 2001 From: Fabrizio Pietrucci Date: Tue, 12 Dec 2023 23:02:59 +0100 Subject: [PATCH] Add new iterable method --- src/lib/core/iter.jsc | Bin 7065 -> 7188 bytes src/lib/core/iter.jsr | 4 ++++ 2 files changed, 4 insertions(+) diff --git a/src/lib/core/iter.jsc b/src/lib/core/iter.jsc index 265398051b01cf87621a11bad43f440ea9fc37a4..334817f7a6db2a0668fd12497d5f474cffb55f6e 100644 GIT binary patch delta 502 zcmX|+-EK@_6o#K~x=mY3ODJiEh%~K;G$KNSp;Lcx@+LFBPA0Ny?6SMjQ8nG;pYhKj zsS_9A3g$>$hdXfrzL_?&j^3=5_2hYfp7}BRt>8-E5B|O=&UwzKX@#OutU-<94ROH} zPII1;nD<-~mpzBX70&^2)iWWkc?ui*+~kn(o`p2sD7pRZS+Qu`5_RKtg|boZQOkiE zdvapQ6Q!xRW87V2h{OnpWn;TYjS+Fr*d^{8W8#6aN34j3cqmrgfOE!P@hGI6F)r4u zEA`mAQthTu5bM^p&5XkpT1G3hs?iDxPdrb>vtGUDy<#tVQZKipUKvNkYhzNpF{T31 zI4a&6$HY71xOi{Oh!4gI@zFRbJ{hOPXXA9}@WnVA*ZJDHnfsG(HzS zx&;{7InVAIuF6E!O_Q5qV24m@RnxSHh!{i=5fKp)5gC%&kImWJr2di~d{sqf8T(D`8T*-2!ifuT z1w9h?;d-pqIQtI1y!kyZ!>>b+Enf1e^?ls;(aKWiK z8gWrDD#dT3TKGndSTkzHAEQpJiw&_Uw!8|@GwQ{5a7By;v11`>*Fw~ug{Z523$+JE zdzzwA45~5|1Hz%>NF0~*PRe1YWz^X>>fGoM7e=SJG`hrJqdQnMdc?KSD{hQFaclI8 sJ7YlH8-wD(_$mGw!_j<>|D~nKN38Uk_>3i@UTnXxTgVqnJGF0BUnA;MQvd(} diff --git a/src/lib/core/iter.jsr b/src/lib/core/iter.jsr index 4162a8bb..3cc44039 100644 --- a/src/lib/core/iter.jsr +++ b/src/lib/core/iter.jsr @@ -109,6 +109,10 @@ class Iterable return interleave(this, sep) end + fun repeat(n=0) + return repeat(this).take(n).flatten() if n != 0 else repeat(this).flatten() + end + fun sorted(comparator=null) return sorted(this, comparator) end