[fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

Dmitry Boyarintsev skalogryz.lists at gmail.com
Mon Jun 10 04:27:43 CEST 2019


On Sun, Jun 9, 2019 at 10:14 PM Ben Grasset <operator97 at gmail.com> wrote:

> I mean, like *many, many, many *things, yes it is technically possible
> for that to be valid Pascal syntax. As far as *should*, well, I'm not
> personally a fan of that sort of too-many-parentheses typecasting, but I
> wouldn't specifically care one way or another if it was added as there's no
> reason for me to.
>
> I fail to see how that is anything more than *distantly *related to what
> we're discussing in this thread, though.
>
Distantly? you're proposing to introduce a reference-to-type declaration
within a parameter. Without giving it any name.
Fine. But that would requires a type-casting within the code to the same
type as has been declared within the parameter.
Otherwise you're creating some type, that cannot be casted-to. Which is odd.

So if you're fan of having ^Integer as a parameter type, then you pretty
much self-declaring to be a fan of (^Integer)(varname) as well.

In general I'm not really interested in playing this sort of FUD-ish *"if
> we add X, it's gonna lead down the road to Largely Unrelated Y!" *
> back-and-forth game, as I find it both childish and a waste of time as
> it's almost always highly unrealistic with regards to whatever is being
> talked about.
>

It's kinda what language designers HAVE to do.
It's nice just to throw out the "next-big-thing-cool-idea" out there and
make yourself look smart.
But you actually HAVE to think everything through.
If you don't then your idea might not be so cool after all.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190609/12146e36/attachment.html>


More information about the fpc-devel mailing list