Re: Design by Contract for perl internals

2000-08-17 Thread Michael G Schwern

On Thu, Aug 17, 2000 at 01:28:29PM -0400, Chaim Frenkel wrote:
 I posted this to -qa and -internal, since I was suggesting this
 for the internal development of perl. Not for the user visible
 pieces.

My mistake.  For the internals, sounds like it couldn't hurt.  Though
I have no idea how put together a DBC system for... what language are
we writing this in again?

-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
Plus I remember being impressed with Ada because you could write an
infinite loop without a faked up condition.  The idea being that in Ada
the typical infinite loop would be normally be terminated by detonation.
-- Larry Wall in [EMAIL PROTECTED]



Re: Design by Contract for perl internals

2000-08-17 Thread Nick Ing-Simmons

Michael G Schwern [EMAIL PROTECTED] writes:

I wouldn't mind an optional OO contract system in the core of Perl,
but this may be a case of "why do it in core when a module will work?"

I _think_ the proposal was to have design-by-contract in the perl core
in the sense that contract is checked when one part of the core 
calls another.  e.g. that when someone does

char *s = SvPV(sv);

Something checks that 'sv' is a SV * and not an HV * or whatever.
Obviously this is a perl-core-compile-time option and would NOT be 
on for production perl as it is SLOW.

Sort of automatically and liberally inserted assert() statements.

-- 
Nick Ing-Simmons