Skip to content

Commit

Permalink
Unreverted necessarily specialized generics.
Browse files Browse the repository at this point in the history
  • Loading branch information
BarAgent committed Feb 18, 2014
1 parent 533af72 commit e3092bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions sources/dylan/collection.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ define constant <collection-type>
define constant <mutable-collection-type>
= type-union(subclass(<mutable-collection>), <limited-mutable-collection-type>);

// This generic is defined on <type> because the DRM says so and the test suite
// expects it to be so. However, the only implemented method is on
// <mutable-collection-type> and this generic is sealed, so there should not be
// a dispatch hit.
define sealed generic map-as
(type :: <mutable-collection-type>, fn :: <function>,
collection :: <collection>, #rest more-collections :: <collection>)
(type :: <type>, fn :: <function>, collection :: <collection>,
#rest more-collections :: <collection>)
=> (new-collection :: <mutable-collection>);

define sealed generic map-into
Expand Down
6 changes: 4 additions & 2 deletions sources/dylan/sequence.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ define sealed generic concatenate
(sequence1 :: <sequence>, #rest sequences :: <sequence>)
=> (result-sequence :: <sequence>);

// This generic is defined on <type> because the DRM says so and the test suite
// expects it to be so. However, the methods top out with <mutable-collection-type>
// and this generic is sealed, so there should not be a dispatch hit.
define sealed generic concatenate-as
(type :: <mutable-sequence-type>,
sequence1 :: <sequence>, #rest more-sequences :: <sequence>)
(type :: <type>, sequence1 :: <sequence>, #rest more-sequences :: <sequence>)
=> (result-sequence :: <mutable-sequence>);

define sealed generic first
Expand Down

0 comments on commit e3092bd

Please sign in to comment.