Is there a way to send an extra parameter between the goout and out typemaps?
Lindley French <[email protected]> Mon, 21 Jul 2025 22:05:51 -0400
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <CALwtg04AJ1u0T9176gfAQ3qsJs36hhXtD8ueZpNFEV-efjfYUQ@mail.gmail.com> |
--===============7715458794165494787== Content-Type: multipart/alternative; boundary="0000000000003f0c35063a7b0a64" --0000000000003f0c35063a7b0a64 Content-Type: text/plain; charset="UTF-8" Is there a way to send an extra parameter between the goout and out typemaps? I'm taking a look at whether there's any practical way to map absl::StatusOr<T> (or std::expected) to Golang's "return T, err" pattern. This requires propagating both an error and a value across the language boundary. We can kindly ask the user to make one of those two an output parameter, but it would be really neat if we could automatically inject an extra parameter between goout and out that doesn't have any corresponding parameter in either the Go or C++ client code. I don't see anything like that in the SWIG docs, but maybe some feature has been added that isn't in the docs? --0000000000003f0c35063a7b0a64 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Is there a way to send an extra parameter between the= goout and out typemaps?</div><div><br></div>I'm taking a look at wheth= er there's any practical way to map absl::StatusOr<T> (or std::ex= pected) to Golang's=C2=A0"return T, err" pattern. This requir= es propagating both an error and a value across the language boundary.<div>= <br></div><div>We can kindly ask the user to make one of those two an outpu= t parameter, but it would be really neat if we could automatically inject a= n extra parameter between goout and out that doesn't have any correspon= ding parameter in either the Go or C++ client code.</div><div><br></div><di= v>I don't see anything like that in the SWIG docs, but maybe some featu= re has been added that isn't in the docs?</div></div> --0000000000003f0c35063a7b0a64-- --===============7715458794165494787== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============7715458794165494787== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Swig-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/swig-user --===============7715458794165494787==--