|
From: | Alice Osako |
Subject: | Re: Design philosophy - why use a VAR for a single return value? |
Date: | Fri, 22 Mar 2024 19:20:33 -0400 |
User-agent: | Mozilla Thunderbird |
On Sat, 23 Mar 2024 at 07:51, Alice Osako <alicetrillianosako@gmail.com> wrote:I am changing the API for CardBitOps to eliminate all VAR parameters for any case where only a single value is returned.
I am baffled as to why the original design used them in the first place, and dealing with that bad design decision was driving me up the wall.
In a parameter list, VAR is for passing by reference.
Unfortunately, neither PIM nor ISO provide pass by immutable reference.
We fixed this flaw in M2R10 by adding CONST for passing by immutable reference.
The reason why you may want to use VAR is efficiency, since passing a pointer is faster than copying a larger data structure.
[Prev in Thread] | Current Thread | [Next in Thread] |