Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WRT *BooleanArray

3 views
Skip to first unread message

Leopold Toetsch

unread,
Feb 20, 2006, 8:55:03 AM2/20/06
to Perl 6 Internals
*) the resizable variant is heavily borked WRT allocation size
fixes welcome

*) I don't think that *BooleanArray should support:

set P0[0], 3.2
set P0[1], "foo"
set P0[2], P1

nor

set N0, P[0]
...

et al. I think, if you use a BooleanArray with compact storage you are
knowing why and don't need automatic conversion to/from float, string,
nor PMC.

What do you think?
leo

Matt Fowles

unread,
Feb 20, 2006, 10:34:30 AM2/20/06
to Leopold Toetsch, Perl 6 Internals
Leo~

I agree that you don't need string. PMC you probably want, since
there are boolean PMCs and what not. Float I am not sure of.

Matt
--
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-Stan Kelly-Bootle, The Devil's DP Dictionary

Bob Rogers

unread,
Feb 20, 2006, 11:23:30 AM2/20/06
to Leopold Toetsch, Perl 6 Internals
From: Leopold Toetsch <l...@toetsch.at>
Date: Mon, 20 Feb 2006 14:55:03 +0100

*) I don't think that *BooleanArray should support:

set P0[0], 3.2
set P0[1], "foo"
set P0[2], P1

So I would need to do

set I1, P1
set P0[2], I1

in order to store the contents of a PMC into a boolean array? What do I
do if I don't know the type of the destination array when I am compiling
this code?

nor

set N0, P[0]
...

et al. I think, if you use a BooleanArray with compact storage you are
knowing why and don't need automatic conversion to/from float, string,
nor PMC.

What do you think?
leo

That would mean that I can't pass a boolean array to code that wants to
operate on a generic array, which seems limiting.

-- Bob Rogers
http://rgrjr.dyndns.org/

Bernhard Schmalhofer

unread,
Feb 20, 2006, 12:25:49 PM2/20/06
to Bob Rogers, Leopold Toetsch, Perl 6 Internals
Bob Rogers schrieb:

As ResizableBooleanArray is meant for general use by HLLs I wouldn't want to
put any special restrictions on it. Everything that can be evaluated in
a Boolean context should be usable for setting the bits in an Array.

Is there a performance penalty for having these methods?

Regards, Bernhard

Leopold Toetsch

unread,
Feb 20, 2006, 2:14:43 PM2/20/06
to Bernhard Schmalhofer, Bob Rogers, Perl 6 Internals

On Feb 20, 2006, at 18:25, Bernhard Schmalhofer wrote:

> Is there a performance penalty for having these methods?

No, just a bit of more code size. Well, looks like compiler writers
wants these methods, so we'll keep 'em.

leo

0 new messages