Hello!

  How would you like if `supremum` tolerated the `f` elements?

  Now:
```
   { f 0 1 2 } supremum
  -> error is thrown

   { f f f f } supremum
  -> error is thrown
```

  Proposition:
```
   { f 0 1 2 } supremum
  -> 2

   { f f f f } supremum
  -> f
```

  Current code:
```
: supremum ( seq -- elt )
    [ ] [ max ] map-reduce ;
```

  Proposed code:
```
: supremum ( seq -- elt )
    [ ] [ 2dup and [ max ] [ dupd ? ] if ] map-reduce ;
```

  If you like what you are seeing, I'll make a formal PRoposal.

---=====--- 
 Александр

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to