home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!wupost!usc!news!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Newsgroups: comp.lang.perl
- Subject: Re: Questions on Perl Source Code.
- Message-ID: <1992Nov16.191456.21565@netlabs.com>
- Date: 16 Nov 92 19:14:56 GMT
- References: <5444@daily-planet.concordia.ca> <5445@daily-planet.concordia.ca>
- Sender: news@netlabs.com
- Organization: NetLabs, Inc.
- Lines: 50
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <5445@daily-planet.concordia.ca> marcap@cs.concordia.ca (PAWLOWSKY marc) writes:
- :
- : Due to a nasty gotch'a in the 80486 my port of PERL has trouble
- : with integers. In particular 1 becomes 1.000000000000000056.
-
- I'd say your sprintf is badly busted...
-
- : Now this little beast cause trouble on unformatted outputs, and
- : when lists are joined, and even trouble with boolean operators.
-
- Certainly.
-
- : Now the question is can anybody tell me where are doubles converted
- : to strings (is it in sprintf statements allover?)
-
- Only one place matters for your purposes. Look for sprintf() in str.c.
-
- : Can anybody
- : tell mhere are the logical operators implemented (e.g. ||, &&, ...).
-
- Those are in eval.c, but I don't think you'll need to touch them.
-
- : Is there a document somewhere that helps explan the C source code.
- : I'm looking for some type of overview, explaining what the data
- : structures are, flow control, tht type of thing.
-
- An internals document? Yikes. If I did that, Perl would now be 582
- languages instead of one language.
-
- Besides, it'd all be obsolete now anyway. Perl 5 doesn't even have
- str.c or eval.c! I recommend that you not spend too much time cozying
- up to my old code, unless perhaps you're a psychologist, or need one.
-
- : Thanks
-
- You're welcome.
-
- : P.S. Hint for next version of PERL, include an integer type
- : that is freely converted between doubles, strings, and integers
- : so this type of portability problem disappears.
-
- The ideal in a language like Perl is that scalars always look like
- strings to the casual observer, with numeric optimizations occurring
- internally. Though it doesn't currently, Perl 5's compiler could
- easily analyze return types and arguments to see where integers can be
- substituted for doubles. Perl 4's compiler simply can't do this,
- because it needlessly defers too many decisions to run-time. It's
- one of the reasons I completely scrapped the old compiler.
-
- Larry
-