From xemacs-m  Tue Jul 29 20:35:30 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id UAA05202
	for <xemacs-beta@xemacs.org>; Tue, 29 Jul 1997 20:35:29 -0500 (CDT)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.6/8.8.6) id SAA23565;
	Tue, 29 Jul 1997 18:39:31 -0700
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: Suggested library function addition
References: <87d8o1plmh.fsf@bittersweet.inetarena.com>
X-Face: `'%\i;ySOu]g?NlziJSk_$&@]KP`}~PEQPjZ5;nxSaDW_o$4+4%Ab]%Ifw3ZR;7TIT3,O,'
 @2{L;]ox6kc;$_5kU'n**9vFg-]eV~GbxSVCx|(s%uR[],*:^WKmC`B}(;|k9/m]gwt?&`t;^rfCJg
 khHH>pP1W\)xM0U@!FNDD72{3fDP$PkBhx^7Z?-WxH6DbFN:QOnT`llzW}VGdYv;n9lzljQvKTIBhQ
 YuV
X-Attribution: sb
From: SL Baur <steve@xemacs.org>
In-Reply-To: karlheg+xemacs@inetarena.com's message of "29 Jul 1997 14:57:26 -0700"
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: text/plain; charset=US-ASCII
Date: 29 Jul 1997 18:39:30 -0700
Message-ID: <m290ypuxm5.fsf@altair.xemacs.org>
Lines: 22
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta16) - "Budapest"

Karl M Hegbloom <karlheg+xemacs@inetarena.com> writes:

>  I think entering file modes as decimal integers is a real pain.

> (defun octal->int (octal-string)
>   "Convert a string of octal digits to an int."

Hrvoje beat you to it.

C-h f string-to-number
string-to-number: (STRING &optional BASE)
  -- a built-in function.
Convert STRING to a number by parsing it as a decimal number.
This parses both integers and floating point numbers.
It ignores leading spaces and tabs.

If BASE, interpret STRING as a number in that base.  If BASE isn't
present, base 10 is used.  BASE must be between 2 and 16 (inclusive).
Floating point numbers always use base 10.

(string-to-number "755" 8)
=> 493

