CL has string-trim string-left-trim string-right-trim
String trimming is all nice and useful, but what if I want to trim lists or vectors? What if I want to invert their result (return margins, instead of middle), like haskell's `init`? Why there are 3 functions, when CL has keywords? Could they also have keywords for capitalize/downcase/upcase work? It would be nice to have a full blown string processing DSL.
CL's string processing is not ideal, but it's not that bad either. I tend to write a small library for some more common things that are not part of CL, and for more advanced stuff there's cl-ppcre.
As for trimming lists? From start? Just use one of the searching functions which traverse the list. remove(-if(-not)) with the right arguments may also achieve the same thing from the end. There's probably many other ways to do it as well. I never contemplated of the concept of trimminga list or vector as these things tend to be better thought of differently (but many times with the same results).
You'll need to be more specific if you want me to give some specific examples.
Could they also have keywords for capitalize/downcase/upcase work?
Do you mean the readtable ones? They are for how symbols are read in and printed (separately).
It would be nice to have a full blown string processing DSL.
If it doesn't have something that you want, you're always welcome to make your own. That's what I do, especially since it's usually fun and easy once you got down the concepts of what you want it to do.
Name:
Anonymous2011-05-21 19:16
As for trimming lists? From start? Just use one of the searching functions which traverse the list. remove(-if(-not))
But remove-if-not works on a whole sequence!
Do you mean the readtable ones? They are for how symbols are read in and printed (separately).
I mean CL has string-capitalize and string-downcase. They could be composed into single DSL.
>>1
Using the language for shit that is best solved with libraries is a failure in terse and minimalistic language design.
People who want keywords to solve all of their problems are retards, like yourself. I bet you want a "quake_engine" keyword added to C so that you can just generate a binary of the quake engine all with a simple keyword.
Perl is such a language with thousands of keywords, and Perl is absolute trite shit.