There are two lisp functions, 'atoi' and 'itoa', I have problems to
explain to new lispers. Not the functionality, but the origin for their
name.
Can anybody explain why they are called 'atoi' and 'itoa' and not 'stoi'
and 'itos'?
Any conflict from other lisp languages, maybe?
Regards,
Mortenw
So, if I had to guess, I would say it's 'array to integer' and 'integer to
array'.
Let me know if you find the real answer!
Stephen Tate
Morten Warankov wrote in message <355C1E53...@abacus.no>...
Ascii TO Integer, and Integer TO Ascii. :)
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
Morten Warankov wrote in message <355C1E53...@abacus.no>...
>[...]
>Can anybody explain why they are called 'atoi' and 'itoa' and not 'stoi'
>and 'itos'?
>Any conflict from other lisp languages, maybe?
>[...]
In article <355C1E53...@abacus.no>, mor...@abacus.no says...
> There are two lisp functions, 'atoi' and 'itoa', I have problems to
> explain to new lispers. Not the functionality, but the origin for their
> name.
>
> Can anybody explain why they are called 'atoi' and 'itoa' and not 'stoi'
> and 'itos'?
> Any conflict from other lisp languages, maybe?
Don't know it it's legitimate or not but it does help you remember their
meaning by thinking of them as...
ATOI = Ascii TO Integer
-and-
ITOA = Integer TO Ascii
Sincerely,
--
Y-------------------------------------------------------------------+
| Darren J. Young | Minnesota CADWorks, Inc. |
| dyo...@mcwi.com | P.O. Box 7293 |
| ftp://ftp.mcwi.com | St. Cloud, Minnesota 56302-7293 |
| http://www.mcwi.com | Phone: 1-320-654-9053 |
| CAD/CAM/CNC - Drafting Design Customization Training Programming |
0,0-----------------------------------------------------------------X
Email addresses not to be sold or used for unsolicited advertisements
No responses will be made to users with altered Email addresses
intended to block SPAM. It takes longer to edit them than hit delete!
Pierre.
:-)
Morten Warankov wrote in message <355C1E53...@abacus.no>...
>Any,
>
>There are two lisp functions, 'atoi' and 'itoa', I have problems to
>explain to new lispers. Not the functionality, but the origin for their
>name.
>
>Can anybody explain why they are called 'atoi' and 'itoa' and not 'stoi'
>and 'itos'?
>Any conflict from other lisp languages, maybe?
>
>Regards,
>
>Mortenw
>
>
>
>A complete guess here (and probably completely wrong!) but I thought it may
>have come from the C language. Both atoi & itoa are available in C. In C
>there are no strings, instead you have an array of characters (terminated in
>a null) .
>
>So, if I had to guess, I would say it's 'array to integer' and 'integer to
>array'.
The functions atoi and itoa stand for ASCII to Integer, and Integer to
ASCII respectively.
--
Regards,
Ian A. White, CPEng
WAI Engineering
Sydney 2000
Australia
Ph: +61 418 203 229
Fax: +61 2 9622 0450
Junk e-mail will be returned, as is, to the sender's host system.
I vote for alpha to integer and integer to alpha.
jrf
On Fri, 15 May 1998 21:06:07 EDT, Jon Fleming <jo...@fleming-group.com>
wrote:
Matt Dillon
The D.C. CADD Company, Inc.
(Remove nospam for email reply)
>Aren't ASCII chars all integers. That's why the (ascii <string>)
>function always returns an integer.
>
>I vote for alpha to integer and integer to alpha.
But itoa will display more than just the alphabetic character. It
displays the representation of the ASCII character.
These functions have been around since before the PDP-11, I believe.
Clifford Middleton wrote:
> I am taking your advice right now, Matt and converting my alphas to ints
> while the rest of the world converts asciis to ints. I hope whoever
> wrote that subr can tell us the secret. It's extremely important to the
> whole programming community.
>
> Matt Dillon wrote:
> >
> > I vote we fergit the whole thing and have a beer. <G>
> >
> > On Fri, 15 May 1998 21:06:07 EDT, Jon Fleming <jo...@fleming-group.com>
> > wrote:
> >
> > >All the many ways of representing characters in computers use integers.
> > >ASCII (American Standard Code for Information Interchange) is a system by
> > >which characters are assigned integer codes. "itoa" accepts an integer
> > >(stored as a binary number), and calculates the ASCII codes for the
> > >characters that make up the decimal representation of that integer. An
> > >"integer to alpha" function could return its result in EBCDIC (Extended
> > >Binary Coded Decimal InterChange, I think), Unicode, card punch codes, or
> > >any of several other coding schemes. Since itoa produces ASCII, I vote tor
> > >"Integer TO Ascii".
> > >
> > >jrf
> > >
> > >In article <355CD819...@tc3net.com>, Clifford Middleton wrote:
> > >> Aren't ASCII chars all integers. That's why the (ascii <string>)
> > >> function always returns an integer.
> > >>
> > >> I vote for alpha to integer and integer to alpha.
> > >>
Ian A. White wrote:
>
> On Fri, 15 May 1998 20:04:41 -0400, Clifford Middleton
> <mid...@tc3net.com> wrote:
>
> >Aren't ASCII chars all integers. That's why the (ascii <string>)
> >function always returns an integer.
> >
> >I vote for alpha to integer and integer to alpha.
>
Ian A. White wrote:
> The functions atoi and itoa stand for ASCII to Integer, and Integer to
> ASCII respectively.
>
Any,
Purely academic discussion following.
If you prefer to have a beer and vote for what your application is doing; do so!
(G)
Ian,
That IS my guess as well, but I wondered if someone had an insight of how this
'inconsistency' started. If you search the net you'll find that due to this
'inconsistency', people are writing their own codes for built-in functions, and I
thought with some further details of how these functions were created, some of
these vasted-time programming hours could have been eliminated.
My 'guess explanation' is that functions converting the TYPE of input and the
input is kept, are called ?to?, whilst functions converting the INPUT (may /may
not be into a different format) have any other naming convention:
itoa, atoi, atof, rtos, distof, etc are all returning the same input in a
different format.
chr, ascii, cvunit, etc... are returning a different value, some in the same
format others in a different format.
If this really makes sense, this settles a naming convention for our own
functions as well as an easier way to search for conversion functions.
Regards,
Mortenw
> I vote we fergit the whole thing and have a beer. <G>
>
Fully agree. Go out and have a beer and vote for what your application is doing.
(G)
Mortenw
Pierre Cardinal a écrit:
> My best guess is "Alpha-numeric" to "Integer" and vice-versa.
>
> Pierre.
>
> :-)
>
> Morten Warankov wrote in message <355C1E53...@abacus.no>...