You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/05/09 18:59:01 UTC

[lucy-issues] [jira] [Commented] (CLOWNFISH-9) Make most Clownfish core types final

    [ https://issues.apache.org/jira/browse/CLOWNFISH-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14536764#comment-14536764 ] 

ASF GitHub Bot commented on CLOWNFISH-9:
----------------------------------------

GitHub user rectang opened a pull request:

    https://github.com/apache/lucy-clownfish/pull/16

    CLOWNFISH-9 Mark most types final

    Mark most core types as `final`: Blob, ByteBuf, CharBuf, Class, Method, Hash, HashIterator, Vector, and the concrete Num types.
    
    Conspicuous omissions include Obj and Err which need to be extensible, and String and StringIterator, which need to be refactored to accommodate stack allocations without subclassing. 
    
    Commit 9a71917, "Export all _IMP symbols" is a bit like swatting a fly with a sledgehammer, but without it, Lucy fails dynamic linking because `CFISH_Num_Equals_IMP` is not exported. I think that over time as more classes are properly marked as `final` and closed off from extensibility, it will have less impact.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rectang/lucy-clownfish CLOWNFISH-9-most-types-final

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucy-clownfish/pull/16.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 #16
    
----
commit f5ad7777d217e8466aa0c32ee1590636ac1e9fd3
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   2015-05-09T01:06:16Z

    Make PerlSub helpers more flexible.
    
    Add an extra argument, `first`, controlling which params to include.
    Don't force the first argument name to `self`.

commit 19d7b7508745a49b725f623da8af159fd21200ff
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   2015-05-09T01:22:31Z

    Bind different func to XS ctor for final classes.
    
    For final classes, look for `new`.  For extensible classes, look for
    `init`.
    
    The effect is to prevent Perl-space subclassing of final classes.

commit 3c977c58f7a143dc0c5829c5fc80cf3a0fc1b0e4
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   2015-05-09T02:04:07Z

    Change test to subclass Obj rather than Hash.
    
    Hash is about to become final, so we need to subclass a class which will
    remain extensible: Obj.

commit 5bd1128544af1cf7111ae4d3bae774e959d2ec95
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   2015-05-09T02:05:31Z

    Export OFFSET vars for `final` methods.
    
    Without the export, symbol resolution fails during dynamic linking.

commit 9a71917c7fdcec8ea2a501b874308983197f8c37
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   2015-05-09T02:24:56Z

    Export all _IMP symbols.
    
    It is not sufficient to export only _IMP symbols for final methods,
    because it's possible that a subclass final method be an alias for it.

commit 8304e2e22f53ce5febbcf863b489f9db23a9aafa
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   2015-05-09T02:27:49Z

    Mark many core types as `final`.
    
    Blob, ByteBuf, CharBuf, Class, Hash, HashIterator, Method, Integer32,
    Integer64, Float32, Float64, Vector.

commit 9180666129b6b32f1795b283ccf96d943db3ffb7
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   2015-05-09T02:56:28Z

    Custom XS ctors for final classes should use new.
    
    Using `init` instead of `new` allows Perl-space subclassing, which is
    inappropriate for final classes.

----


> Make most Clownfish core types final
> ------------------------------------
>
>                 Key: CLOWNFISH-9
>                 URL: https://issues.apache.org/jira/browse/CLOWNFISH-9
>             Project: Apache Lucy-Clownfish
>          Issue Type: Bug
>          Components: Runtime
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>
> Obj and Err are designed to be extended.  Most everything else should be sealed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)