s-news
[Top] [All Lists]

Re: [S] ls vs. objects

To: "Wright, Kevin" <WRIGHTKEVI@phibred.com>
Subject: Re: [S] ls vs. objects
From: Martin Maechler <maechler@stat.math.ethz.ch>
Date: Thu, 25 May 2000 09:21:49 +0200 (CEST)
Cc: "S-News (E-mail)" <s-news@wubios.wustl.edu>
In-reply-to: <C71CB7425639D311A7A40008C7286AB001984B2A@carina.phibred.com>
References: <C71CB7425639D311A7A40008C7286AB001984B2A@carina.phibred.com>
Reply-to: Martin Maechler <maechler@stat.math.ethz.ch>
Sender: owner-s-news@wubios.wustl.edu
>>>>> "KWri" == Wright, Kevin <WRIGHTKEVI@phibred.com> writes:

    KWri> As (also) a former UNIX diehard, I much prefer "ls" to "objects".  
When I
    KWri> look at the code for "ls" I see:

    --> ls
    KWri> function(pattern = "", pos = 1)
    KWri> {
    KWri>  if(pattern != "")
    KWri>       stop("ls() is deprecated; patterns not allowed; use objects()")
    KWri>  objects(pos)
    KWri> }

    KWri> Now, this is most curious.  Why didn't MathSoft provide us with this
    KWri> revision of "ls"?

    KWri> ls_function(pattern = "", pos = 1)
    KWri> {
    KWri>  objects(pos,pattern=pattern)
    KWri> }

because "pattern" in ls() and objects() have very different meaning:
 "pattern" for ls         means "wildcards"
 "pattern" for objects()  means "regular expressions" [aka "regex(p)"s].
                          {the documentation ?objects mentions ?grep
                           and grep mentions reg.exp.s}

BTW:  In R  {www.r-project.org},  
      ls & objects are synonymous  {and pattern always means "regexp"}.

Martin Maechler <maechler@stat.math.ethz.ch>    http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10    Leonhardstr. 27
ETH (Federal Inst. Technology)  8092 Zurich     SWITZERLAND
phone: x-41-1-632-3408          fax: ...-1228                   <><
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>