Skip to content

Commit

Permalink
Make implementation of EclectusBoolean closer to PhpBoolean
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Mar 22, 2009
1 parent ce377c4 commit ec5a767
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
31 changes: 20 additions & 11 deletions src/pmc/eclectusboolean.pmc
@@ -1,5 +1,4 @@
/*
Copyright (C) 2007, The Perl Foundation.

=head1 NAME

Expand All @@ -18,20 +17,30 @@ boolean behavior.

*/



pmclass EclectusBoolean
extends Boolean
does boolean
extends Boolean
provides scalar
provides boolean
provides integer
dynpmc
group eclectus_group
hll Eclectus
maps Boolean {
group eclectus_group
hll Eclectus
maps Boolean {

STRING* get_string() {
return PMC_int_val(SELF) ?
const_string(INTERP, "#t")
:
const_string(INTERP, "#f");
=item C<STRING* get_string()>

Return the string '1' or ''.

=cut

*/
STRING* get_string() {
if (SELF.get_integer())
return Parrot_str_new_constant(INTERP, "#t");
else
return Parrot_str_new_constant(INTERP, "#f");
}
}

Expand Down
5 changes: 1 addition & 4 deletions t/pmc/boolean.t
@@ -1,7 +1,3 @@
#! ../../parrot
# Copyright (C) 2008, The Perl Foundation.
# $Id$

=head1 NAME

t/pmc/boolean.t - Boolean PMC
Expand All @@ -20,6 +16,7 @@ Tests C<EclectusBoolean> PMC.
$P0 = loadlib "eclectus_group"

.include "include/test_more.pir"

plan(2)

truth_tests()
Expand Down

0 comments on commit ec5a767

Please sign in to comment.