From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Yegge Newsgroups: gmane.emacs.devel Subject: Re: proposal to make null string handling more emacs-y Date: Thu, 26 Apr 2012 14:20:45 -0700 Message-ID: References: <83d36wfcf1.fsf@gnu.org> <834ns7g9r8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf305b12669772e604be9b8f5d X-Trace: dough.gmane.org 1335475259 9741 80.91.229.3 (26 Apr 2012 21:20:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2012 21:20:59 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 26 23:20:58 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SNW7V-0005q5-RQ for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2012 23:20:57 +0200 Original-Received: from localhost ([::1]:39928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNW7V-0004xG-48 for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2012 17:20:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNW7R-0004wt-HN for emacs-devel@gnu.org; Thu, 26 Apr 2012 17:20:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SNW7P-0007en-S0 for emacs-devel@gnu.org; Thu, 26 Apr 2012 17:20:53 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:43276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNW7M-0007ac-GM; Thu, 26 Apr 2012 17:20:48 -0400 Original-Received: by yenm8 with SMTP id m8so64700yen.0 for ; Thu, 26 Apr 2012 14:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2A7sv4BQJLnQ2pGrhTWAFe5mtTbtcgny72F1WUvLsC4=; b=LTxBcN/EDrLSE/fh/RtZQzti1uAvGk7xIjm0JklzKJXpLHXwKt17GwGsfol+3uzZ+0 MyDTMhYU3ECYP27H79rkg0BXObRUHyuTO+cPsKj7d3+upm+7RszPPaV9KhGSsl2WlVoH Zp62cW+LL3a0S97HuIDLxtnZv/vpnR0liVH5FcsHRKSOPHWqTTZ4bscl6XwhccBQYkFu TLIaSAdX/U+6QwD5H54Szb1UYDQRVftT56FzVIPTvxeiC7fqbymFE0XYgo2DiGcJP4HH cIavu7q0JPWJEvpThoCJ8vkEWT7B44MKAv0p2nxLctZp7UTCGvSjLGh9e2K7eBm0NDQ3 6Bww== Original-Received: by 10.236.181.39 with SMTP id k27mr8475465yhm.52.1335475245117; Thu, 26 Apr 2012 14:20:45 -0700 (PDT) Original-Received: by 10.236.156.72 with HTTP; Thu, 26 Apr 2012 14:20:45 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150067 Archived-At: --20cf305b12669772e604be9b8f5d Content-Type: text/plain; charset=ISO-8859-1 If the general change is too risky, I think there are still a few functions that would benefit from being able to accept nils on a case-by-case basis. Examples: looking-at, string-match, search-forward-* string-to-list, string-to-vector, (maybe) string-to-number auto-save-file-name-p, backup-file-name-p directory-file-name, expand-file-name, file-name-as-directory and their ilk (all of which handle "" gracefully) rename-file, copy-file, delete-file ("no such file/dir" being more informative than "wrong type argument" here) write-file (prompts on empty string; might as well prompt on nil) There's a lot of code out there that's forced to do type assertions on string args that could be simplified if these common functions could accept nils. -steve --20cf305b12669772e604be9b8f5d Content-Type: text/html; charset=ISO-8859-1
If the general change is too risky, I think there are still a few functions that
would benefit from being able to accept nils on a case-by-case basis.
Examples:

looking-at, string-match, search-forward-*
string-to-list, string-to-vector, (maybe) string-to-number
auto-save-file-name-p, backup-file-name-p
directory-file-name, expand-file-name, file-name-as-directory and their ilk (all of which handle "" gracefully)
rename-file, copy-file, delete-file ("no such file/dir" being more informative than "wrong type argument" here)
write-file (prompts on empty string; might as well prompt on nil)

There's a lot of code out there that's forced to do type assertions on string args
that could be simplified if these common functions could accept nils.

-steve
--20cf305b12669772e604be9b8f5d--