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

Implement handling of Ordergin $by in Range.min and Range.max. #756

Closed
p6rt opened this issue Mar 8, 2009 · 5 comments
Closed

Implement handling of Ordergin $by in Range.min and Range.max. #756

p6rt opened this issue Mar 8, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 8, 2009

Migrated from rt.perl.org#63716 (status was 'rejected')

Searchable as RT63716$

@p6rt
Copy link
Author

p6rt commented Mar 8, 2009

From @bacek


src/classes/Range.pir | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

@p6rt
Copy link
Author

p6rt commented Mar 8, 2009

From @bacek

61f6280bc9adf04116bf8eccf64a5cc2a12941f3.diff
diff --git a/src/classes/Range.pir b/src/classes/Range.pir
index 6b7eeb9..4cdb54f 100644
--- a/src/classes/Range.pir
+++ b/src/classes/Range.pir
@@ -137,11 +137,23 @@ just return a clone of the Range.
 .namespace ['Range']
 
 .sub 'max' :method
+    .param pmc by       :optional
+    .param int has_by   :opt_flag
+    if has_by goto have_by
     .tailcall self.'to'()
+  have_by:
+    $P0 = self.'list'()
+    .tailcall $P0.'max'(by)
 .end
 
 .sub 'min' :method
+    .param pmc by       :optional
+    .param int has_by   :opt_flag
+    if has_by goto have_by
     .tailcall self.'from'()
+  have_by:
+    $P0 = self.'list'()
+    .tailcall $P0.'min'(by)
 .end
 
 .sub 'minmax' :method

@p6rt
Copy link
Author

p6rt commented Mar 10, 2009

From @pmichaud

On Sat Mar 07 21​:58​:33 2009, bacek wrote​:

---
src/classes/Range.pir | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

Patch rejected. S03​:2885 describes slightly different semantics for
.min and .max in Ranges, and doesn't mention an Ordering parameter at all.

If the synopses are later modified so that Range.min and Range.max
accept an Ordering $by parameter, I suspect the end result will be that
we inherit .min and .max from Any in that case.

Thanks for submitting!

Pm

@p6rt
Copy link
Author

p6rt commented Mar 10, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 10, 2009

@pmichaud - Status changed from 'open' to 'rejected'

@p6rt p6rt closed this as completed Mar 10, 2009
@p6rt p6rt added the patch label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant