Re: Structs in gobject-introspection + Javascript
Dan Winship <[email protected]> Mon, 10 Nov 2008 11:12:58 -0500
| Newsgroups | gmane.comp.gnome.language-bindings |
|---|---|
| Message-ID | <[email protected]> |
Havoc Pennington wrote: > Hi, > > On Mon, Nov 10, 2008 at 9:07 AM, Dan Winship <[email protected]> wrote: >> Another argument against this API is that presumably this would break if >> the user did >> >> request = { width: 100, height: 50 }; >> >> instead, which would be pretty non-obvious. > > I would think the above is obviously broken? It confuses a reference > with a value, any competent programmer should get that... > (there's no way to make the above work in JavaScript, afaik ... maybe > I'm missing what you're saying) Hm... well, I guess the confusion is that we're talking about having an "out" or "inout" parameter which *isn't* pass-by-reference. I suppose if you stop to think that Javascript doesn't have pass-by-reference then that would be obvious, but presumably the corresponding methods in C++ and C# *would* use "GtkRequisition&" / "out Gtk.Requisition", and so assigning to request like above in those languages *would* work. So again, this is an argument for doing out params as return values like now, rather than as sort-of-references. -- Dan _______________________________________________ language-bindings mailing list [email protected] http://mail.gnome.org/mailman/listinfo/language-bindings