Jump to content

group-lst


Recommended Posts

Is there a function like group-list in PWGL:

 

SYSTEM GROUP-LST   (LIST GROUP-LENS):
groups list into subsequnces, where group-lens indicates
the length of each sublist. group-lens can be a number or a list of numbers.
If list is not exhausted by group-lens, the last value of
 group-lens will be used as a constant until list has been exhausted.

 

(group-lst lis '(1 2 3 4 5 6 7 8 9 10) '(2 3 5)) ; => ((1 2) (3 4 5) (6 7 8 9 10))

(group-lst lis '(1 2 3 4 5 6 7 8 9 10) '(2 3 4)) ; => ((1 2) (3 4 5) (6 7 8 9) (10))

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy