String utility changes/additions
Raymond Martin <[email protected]> Tue, 21 Mar 2006 00:31:36 +0000
| Newsgroups | gmane.lisp.lush.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I want to add some string utilities into CVS, but first I'd like to give a little info and get feedback before I commit it. Firstly, there are presently a few functions in Standard Libraries -> Shell Commands -> String List Utilities that, as far as I can tell, seem to be in the wrong place or can be generalized for better use. So I just want to move these around and fix them up to start with. In there we have: glob split-words merge-words read-lines write-lines #P "glob" is basically a matching function that can be used in other places. A name like "matches" or "matches-list" is more appropriate. "split-words" is really a tokenizer, albeit not a general enough one. I have generalized this function and named it "tokenize", adding a delimiter parameter that users can supply. "merge-words" really merges any strings it is given, not just words (it has no logic to determine whether it is given words or not). Actually no merging is done at all by this function, rather a new string is created. I propose a "merge-strings" name instead. "read-lines" reads from a file and is out of place by its name being next to "write-lines". Should probably be renamed to something like "read-file-lines". "write-lines" and "#P" seem okay for now. I believe these should be in libstd/strings.lsh and have a help entry under Core Interpreter and Startup Library -> Strings -> String Utilities. As for the code in shell.lsh that corresponds to these, I can just make those functions be aliases for the ones to be in strings.lsh (with requisite parameters as needed). Cheers. Raymond __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642