William James
5/21/2015 8:46:00 AM
Steve Gonedes wrote:
> Using loop, it could look like the following.
>
> (defun first-word (str)
> (or (loop for ch across str as idx upfrom 0
> when (char= ch #\Space)
> return (subseq str 0 idx))
> str))
Gauche Scheme:
The hard way:
(use srfi-42 :only (string-ec))
(string-ec (:while (: c "foo bar") (not (eq? c #\space))) c)
===>
"foo"
The easy way:
(car (string-split "foo bar" #\space))
===>
"foo"
Another way:
(use srfi-13 :only (string-tokenize))
(car (string-tokenize " foo bar"))
===>
"foo"
--
From the New York Times of October 11, 1991, page 15, we learn that ... a
committee of researchers at Boston University admitted that, "There is no
question but that Dr. King plagiarized in the dissertation." -- K.A. Strom
[Jesse Jackson] would spit into the food of white patrons he hated and then
smilingly serve it to them. He did this, he said, "because it gave me
psychological gratification." -- Life Magazine, 1969-11-29