-
The higher order function version could use this as its collect:
:collect (funcall function string :start start :end (or end (length string)))
That would only require changing the function signature to:
(defun parse-and-split-string (string function &optional debug)
Then it could be called like this:
(parse-and-split-string "123 23487 39" (lambda (string &key start end) (read-from-string string t nil :start start :end end)))
-
Finally, using the higher order function version, we have just reinvented a subset of yet another
split-sequence
if we have a "plain" parse function. That function issubseq
:(parse-and-split-string "123 456 789" (lambda (seq &key start end) (subseq seq start end))) ;; => ("123" "456" "789")
Edited by Michael Babich
Please register or sign in to comment