Ken Fox <[EMAIL PROTECTED]> wrote:
> David Mitchell wrote:
> > Now of course if we have the luxury of deciding that core perl 'knows'
> > about complex numbers, then of  the parser can be made to recognise ...
> 
> The core doesn't need to know -- that was my point. All the core needs
> is the basic constant folding rules _it_already_has_ combined with a
> macro to define "i". When you "use complex" the macro would be folded
> into the parser. The core doesn't need any special support (other than
> decent macros... ;)

Not being au fait with all RFCs atc, are there any concrete proposal
for macros like this, ir is this just a hazy suggestion?

> 
> > In summary: Perl shouldn't do interpetation of numeric literals, but
> > should instead delegate it to the numeric class currently in scope.
> 
> I agree with you. The complication is that there isn't *a* numeric class
> in scope -- there are *many* numeric classes.

Well, I was assuming that there would be *a* numeric class in scope
- as defined be the innermost lexical 'use foo'.
I assumed that Perl wouldn't be clever enough to know about all available
numberic types and automatically chose the best representation; rather
that it was the programmer's responsibilty via 'use' or some other syntax.

> We could model numeric
> classes as a tower ala Scheme in which case a constant is given to the
> most fundamental class first and then the classes higher up the tower.
> The core might just implement this by throwing a compile-time exception
> that can be caught by the classes higher up the tower. (I think the only
> real problem here is handling large precision numbers -- everything else
> can be handled with macros and constant folding.)

I'm not familiar with Scheme, I'm afraid.

Reply via email to