What is the reasoning behind the lack of conversions when passing parameters

Carl Sturtivant sturtivant at gmail.com
Wed Feb 14 17:46:13 UTC 2024


On Wednesday, 14 February 2024 at 04:41:45 UTC, Walter Bright 
wrote:
> On 2/13/2024 4:38 PM, Carl Sturtivant wrote:
>> Variant is important to some of us because of its 
>> universality. If all conversions are blocked for parameter 
>> passing, can a replacement of Variant (say Any) be added to 
>> the list to be a part of the language?
>> 
>> This would be so that any literal or value of any type can be 
>> passed to a parameter of type Any, enabling naive scripting 
>> and experimenting in any context without an import.
>
> Isn't that what a sumtype is?

Informally Any would be the sum of all types. Would your proposal 
encompass this?


More information about the Digitalmars-d mailing list