[
https://issues.apache.org/jira/browse/CLOWNFISH-57?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14652902#comment-14652902
]
ASF GitHub Bot commented on CLOWNFISH-57:
-----------------------------------------
GitHub user rectang opened a pull request:
https://github.com/apache/lucy-clownfish/pull/29
CLOWNFISH-57 Obj to Go empty interface
Autogenerated bindings for Clownfish subroutines which accept or return
clownfish Obj should be mapped to Go's "empty interface" type,
`interface{}`.
This sacrifices some type safety, but it is the only way to achieve certain
desirable effects. For example, it should be possible for Vector's Push()
method to take a Go string, instead of requiring the user to perform a
manual
conversion to a Clownfish object. Similarly, Vector's Pop() should be able
to
return a Go string.
Functions which need to return an actual clownfish Obj wrapped in a Go
struct
will need to have hand-coded bindings, but there are fewer of those so
converting Obj by default is the better choice.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rectang/lucy-clownfish
CLOWNFISH-57-obj-to-empty-interface
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucy-clownfish/pull/29.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #29
----
commit a121da47ff968f6acc45ab6cf491d01878174193
Author: Marvin Humphrey <[email protected]>
Date: 2015-08-03T23:50:49Z
Convert nullable args safely.
Use `GoToClownfish`, which can handle nil values safely, rather than the
lower-level `GoToString` etc. which are not nil-safe.
commit 258e19a8a57ed453eb4298566eac2062c7560028
Author: Marvin Humphrey <[email protected]>
Date: 2015-08-04T00:08:57Z
Change "is_string_type" to "cfish_string".
Be consistent with "cfish_vector", "cfish_blob", etc. -- which we also
need to test for.
commit 8c26a1d851753f2d692fff82ff681d303eacb3c6
Author: Marvin Humphrey <[email protected]>
Date: 2015-08-04T00:19:23Z
Map clownfish.Obj to Go `interface{}`.
----
> Map clownfish.Obj to Go empty interface
> ---------------------------------------
>
> Key: CLOWNFISH-57
> URL: https://issues.apache.org/jira/browse/CLOWNFISH-57
> Project: Apache Lucy-Clownfish
> Issue Type: Improvement
> Components: Go
> Reporter: Marvin Humphrey
> Assignee: Marvin Humphrey
> Fix For: 0.5.0
>
>
> Autogenerated bindings for Clownfish subroutines which accept or return
> clownfish Obj should be mapped to Go's "empty interface" type, `interface{}`.
> This sacrifices some type safety, but it is the only way to achieve certain
> desirable effects. For example, it should be possible for Vector's Push()
> method to take a Go string, instead of requiring the user to perform a manual
> conversion to a Clownfish object. Similarly, Vector's Pop() should be able to
> return a Go string.
> Functions which need to return an actual clownfish Obj wrapped in a Go struct
> will need to have hand-coded bindings, but there are fewer of those so
> converting Obj by default is the better choice.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)