Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

:Re: Beginner - Function Critique

8 views
Skip to first unread message

Robert L.

unread,
Nov 30, 2016, 5:31:06 PM11/30/16
to
Pascal Bourguignon wrote:

> (defun read-file (filename delimiter)
> "Return a list of lists containing strings in pathname FILENAME
> delimited by character DELIMITER."
> (with-open-file (in filename)
> (loop
> :for line = (read-line in nil)
> :while line
> :collect (line-split line delimiter))))

Note that he is cheating; there is no "line-split" in CL (COBOL-Like).


Ruby:

IO.readlines('2.bak').map{|s| s.split /\s+/}
==>[["04", "1983"], ["03", "1982"], ["02", "1981"], ["01", "1980"]]

In Forth?

--
Jewish drug dealers, child porn pushers, and slave traders are free
from prosecution in Israel. Israel does not consider these to be
crimes ... so long as the victims are non-Jews.
www.theoccidentalobserver.net/2009/08/the-culture-of-deceit/
0 new messages