-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Moo to built-in class (#685)
Showing
52 changed files
with
425 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
--novalign-side-comments | ||
--freeze-newlines | ||
--keep-old-breakpoints-after='(' | ||
--nowant-right-space='A' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
31 changes: 12 additions & 19 deletions
31
exercises/practice/binary-search-tree/lib/BinarySearchTree.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
package BinarySearchTree; | ||
|
||
use v5.40; | ||
use Moo; | ||
|
||
package BinarySearchTree::Node { | ||
use Moo; | ||
use experimental qw<class>; | ||
|
||
has data => ( | ||
is => 'ro', | ||
); | ||
has [qw<left right>] => ( | ||
is => 'rw', | ||
); | ||
}; | ||
class BinarySearchTree; | ||
|
||
has root => ( | ||
is => 'rw', | ||
); | ||
field $root :param; | ||
|
||
sub add ($self) { | ||
method add () { | ||
|
||
# $self->root contains the initial node. | ||
# $root contains the initial node. | ||
} | ||
|
||
sub sort ($self) { | ||
method sort () { | ||
return []; | ||
} | ||
|
||
class BinarySearchTree::Node { | ||
field $data :reader :param; | ||
field $left :reader; | ||
field $right :reader; | ||
} | ||
|
||
1; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.