lispdoc - results for substitute |
(substitute new old sequence &rest args &key from-end (test #'eql) (test-not nil) (start 0) (count nil) (end nil) (key nil)) | Function: Return a sequence of the same kind as SEQUENCE with the same elements, except that all elements equal to OLD are replaced with NEW.
|
Example:(defun make-safe-js-name (fun-name) "Trivial function to switch dashes to underscores. Javascript is rubbish about this. More needs to be done." (substitute #\_ #\- fun-name)) | Mentioned in: CLtL2 - 14.3. Modifying Sequences CLtL2 - 15.4. Substitution of Expressions HyperSpec - Function SUBSTITUTE, SUBSTITUTE-IF, SUBSTITUTE-IF-NOT, NSUBSTITUTE, NSUBSTITUTE-IF, NSUBSTITUTE-IF-NOT PCL - destructive operations PCL - hash table iteration PCL - sequence iterating functions PCL - trees Successful Lisp - chapter13 |
(substitute-if new predicate sequence &rest args &key from-end (start 0) (end nil) (count nil) (key nil)) | Function: Return a sequence of the same kind as SEQUENCE with the same elements except that all elements satisfying the PRED are replaced with NEW.
|
Example:(defun remove-punctuation (string) "Replace punctuation with spaces in string." (substitute-if #\ #'punctuation-p string)) | Mentioned in: HyperSpec - Function SUBSTITUTE, SUBSTITUTE-IF, SUBSTITUTE-IF-NOT, NSUBSTITUTE, NSUBSTITUTE-IF, NSUBSTITUTE-IF-NOT PCL - trees Successful Lisp - chapter13 |
(substitute-if-not new predicate sequence &rest args &key from-end (start 0) (end nil) (count nil) (key nil)) | Function: Return a sequence of the same kind as SEQUENCE with the same elements except that all elements not satisfying the PRED are replaced with NEW.
|
| Mentioned in: HyperSpec - Function SUBSTITUTE, SUBSTITUTE-IF, SUBSTITUTE-IF-NOT, NSUBSTITUTE, NSUBSTITUTE-IF, NSUBSTITUTE-IF-NOT Successful Lisp - chapter13 | |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| By Bill Moorier |