I can only half-way read this at all (and that takes considerable
crossing of my eyes) because of it being posted in quoted printable
(and I didn't even try the html copy). Please post in plain text if
you expect everyone to be able to read it. But continuing on...
I think you were asking about overwriting the sqrt intrinsic with
one of your own, which would apparently return an array of results???
Anyway, I think that's what you were asking. You mentioned multiple
results. I'm not quite sure how you expected to return them, though.
Probably the first step is to define precisely what you want; I'm
not sure whether this got lost because of the hard time I had reading
it or because it wasn't in the original. How are these multiple
results returned? In an array? And what determines the size of this
array, if that is the mechanism?
Recall that sqrt is elemental - it can take array arguments and return
array results of the same rank. This can complicate matters
substantially, as returning an array for a scalar argument is
incompatible with being elemental. (I guess perhaps you could still
write a specific for each rank, but that's quite a mess...unless the
only thing yuo want to handle is a scalar. I'm not quite sure whether
that would end up legal or not...really messy in any case.)
I strongly recommend against overriding the intrinsic, however. I
seem to recall that there was considerable debate as to whether it was
allowed or not, but I think the answer in the end was that it was
allowed if I recall correctly. But that doesn't mean you have to do
that. Is it that big a deal to use a different spelling? You will
save yourself no end of confusions and subtle bug possibilities.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|