Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRE submethods in a class don't check instance preconditions in Rakudo #3497

Open
p6rt opened this issue Aug 31, 2014 · 3 comments
Open

PRE submethods in a class don't check instance preconditions in Rakudo #3497

p6rt opened this issue Aug 31, 2014 · 3 comments
Labels
NYI Features not yet implemented

Comments

@p6rt
Copy link

p6rt commented Aug 31, 2014

Migrated from rt.perl.org#122658 (status was 'open')

Searchable as RT122658$

@p6rt
Copy link
Author

p6rt commented Aug 31, 2014

From @masak

<masak> m​: class IncList { has @​.values; submethod PRE { @​!values eqv
@​!values.sort } }; say IncList.new(​:values(1, 5, 3))
<camelia> rakudo-moar 5f9cd5​: OUTPUT«IncList.new(values => Array.new(1, 5, 3))␤»
* masak submits NYI rakudobug
<masak> m​: say [1, 5, 3] eqv [1, 5, 3].sort
<camelia> rakudo-moar 5f9cd5​: OUTPUT«False␤»

My expectation is that, since the condition is False, the object would
fail the precondition at creation time.

@p6rt
Copy link
Author

p6rt commented Dec 16, 2015

From @jnthn

On Sat Aug 30 21​:18​:35 2014, masak wrote​:

<masak> m​: class IncList { has @​.values; submethod PRE { @​!values eqv
@​!values.sort } }; say IncList.new(​:values(1, 5, 3))
<camelia> rakudo-moar 5f9cd5​: OUTPUT«IncList.new(values =>
Array.new(1, 5, 3))␤»
* masak submits NYI rakudobug
<masak> m​: say [1, 5, 3] eqv [1, 5, 3].sort
<camelia> rakudo-moar 5f9cd5​: OUTPUT«False␤»

My expectation is that, since the condition is False, the object would
fail the precondition at creation time.

Support for PRE and POST submethods is deferred until 6.d or later. All uppercase names are semi-reserved anyway, so it won't really be a backwards compatibility issue to add this functionality later, and while it's nice to have, there's not huge demand for it.

Thus, removing it from the xmas list.

@p6rt
Copy link
Author

p6rt commented Dec 16, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the NYI Features not yet implemented label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NYI Features not yet implemented
Projects
None yet
Development

No branches or pull requests

1 participant