Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Multisplit/PicoLisp/multisplit.l
Normal file
19
Task/Multisplit/PicoLisp/multisplit.l
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
(de multisplit (Str Sep)
|
||||
(setq Sep (mapcar chop Sep))
|
||||
(make
|
||||
(for (S (chop Str) S)
|
||||
(let L
|
||||
(make
|
||||
(loop
|
||||
(T (find head Sep (circ S))
|
||||
(link
|
||||
(list
|
||||
(- (length Str) (length S))
|
||||
(pack (cut (length @) 'S)) ) ) )
|
||||
(link (pop 'S))
|
||||
(NIL S (link NIL)) ) )
|
||||
(link (pack (cdr (rot L))))
|
||||
(and (car L) (link @)) ) ) ) )
|
||||
|
||||
(println (multisplit "a!===b=!=c" '("==" "!=" "=")))
|
||||
(println (multisplit "a!===b=!=c" '("=" "!=" "==")))
|
||||
Loading…
Add table
Add a link
Reference in a new issue