Re: A concept for Exceptions

2002-10-22 Thread Piers Cawley
Luke Palmer [EMAIL PROTECTED] writes:

 From: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Date: Tue, 15 Oct 2002 14:33:28 -0400

 I like the idea of this.  The finer details, like returning what to
 do, could be more elegant.  But the extensibility idea is golden.

 To change how certain exceptions behave, a block simply changes the methods
 of the existing ExceptionCreator to point to other subroutines.  This
 approach allows for an ala carte style of exception configuration.  Blocks
 can (through a module that makes this sort of thing easy), clone the
 ExceptionCreator object, then change just the methods that are desired.  A
 reference to that new object is passed down the line to child blocks.

 I think a clone should be implicit (and lazy).  Exception handlers
 should be lexically (or dynamically?) scoped.  Dynamically could be
 useful in that if a module generated some known exception, you could
 tell it what to do---on it's level.  I worry that this could break
 things too easily, though.

 I definitely like this idea in that it eliminates a lot of
 redundancy.  Instead of 10 CATCH blocks doing the same thing with
 different names, you just have one handler that does it all.
 Exceptions are always something that seemed tedious to me (though I
 have had some fun with them), and this might possibly relieve that.

If you have 10 different exceptions that you want to handle in the
same way then you should probably look at subclassing them. Then all
you have to do is

try {
...
CATCH MyExceptionParent { ... }
}

-- 
Piers

   It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite.
 -- Jane Austen?



Re: Character Properties

2002-10-22 Thread Erik Steven Harrison
 
--

On Mon, 21 Oct 2002 16:49:57  
 Dan Sugalski wrote:

Almost. At least perl 5's macros look like C. Emacs' macro horrors 
make C look like Lisp...

This is because C is _clearly_ a dialect of Lisp . . . 

-Erik

-- 
 Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
   teddy bears get drunk




Get 25MB of email storage with Lycos Mail Plus!
Sign up today -- http://www.mail.lycos.com/brandPage.shtml?pageId=plus 



Re: Character Properties

2002-10-22 Thread Larry Wall
On Tue, 22 Oct 2002, Erik Steven Harrison wrote:
: On Mon, 21 Oct 2002 16:49:57  
:  Dan Sugalski wrote:
: 
: Almost. At least perl 5's macros look like C. Emacs' macro horrors 
: make C look like Lisp...
: 
: This is because C is _clearly_ a dialect of Lisp . . . 

Yeah, look at all the extra parentheses around things like
conditionals and argument lists...

Larry




Perl 6 Summary for last week

2002-10-22 Thread Piers Cawley
The Perl 6 Summary for the week ending 20021020
I'm sorry to have to inform you that I've returned from my holiday (no,
base jumping and paragliding were *not* involved) and that this week's
summary will not be written by the estimable Leon Brocard. Sorry about
that. Leon is currently taking a rest cure.

So, with the customary mention of Mister Brocard out of the way good and
early this week, it's time to take a look at what's been discussed on
the internals list:

  Regarding JVM - Parrot Compatibility
Newcomer Karthik Kumar is interested in writing a tool to convert java
.class files to parrot .pbc files and asked for information on what
had been done in this area. Leon Brocard says it's very easy to get the
basics working because of the low number of JVM bytecodes. But getting
the fundamentals (classes, objects) right is hard. Ramesh
Ananthakrishnan commented that it might be a little early for anything
more than proofs of concept at the moment as Parrot is a rapidly moving
target. Ramesh also came up with the idea of compiling `real machine'
assembly language to `virtual machine' parrot assembler.

Karthik commented that the real issue seems to be one of what level of
support Parrot will offer for objects, and until that is known the
class-parrot problem is almost pointless to solve.

http://makeashorterlink.com/?S18F26432

http://makeashorterlink.com/?C19F22432 -- Ramesh clarifies his `Linux
in Parrot' idea.

  The Getting Started Guide
Erik Lechak is still not loving POD but, despite his distaste he posted
version 0.4 of his getting started guide in POD format. Thanks a lot
Erik. Marty Pauley suggested that Erik take a look at the Simple
Document Format which may meet his needs better than POD

http://makeashorterlink.com/?F2AF11432

http://makeashorterlink.com/?Z5BF34432

  C# and Parrot
Rhys Weatherly, author of Portable.NET, part of the DotGNU project made
a welcome appearance on the list. Apparently the DotGNU people are
looking into compiling C# down to parrot bytecode and hoped that there
might be parrot people who were interested in trying to complete their
compiler and system library.

Rhys wanted to know how to make a user-defined class in Parrot; what the
convention is for which registers must be saved across a call; the size
of int and whether there was a way to store and access auxiliary data
in a Parrot bytecode file.

Answers were provided. Sadly, the answer to Rhys's question about
user-defined classes was You don't, yet. Other answers were more
immediately useful.

The DotGNU weekly IRC meeting discussed Parrot this week, Leon and Dan
managed to cover both sessions between them, and there's a log
available.

http://makeashorterlink.com/?M2CF21432

http://makeashorterlink.com/?J1DF11432 -- Condensed summary of the
meeting

http://ajmitch.dhis.org/dotgnu/ -- unedited logs available here

  Variable/Value Split Prelims
Leopold Toetsch rather confused me when he replied to a two week old
message (I thought I'd completely screwed up setting the `limit by date'
values in my summary buffer) about the conceptual split between
variables and values. Leo wanted some clarification which Dan provided.

http://makeashorterlink.com/?M4EF21432 -- Dan's old message

http://makeashorterlink.com/?C3FF22432 -- Leo's questions

  PMC Initializers
Leon Brocard attempted to kick start discussion of Jonathan Sillito's
patch to pass more information when creating new PMCs. Leopold Toetsch
and Josef Höök both said they thought that something along those lines
was a good idea, but the discussion seemed to die there. Later in the
week, Dan introduced the new init_pmc function to PDD02, which works
along the lines suggested.

http://makeashorterlink.com/?V20023532

http://makeashorterlink.com/?I11021532

  PerlHash questions
Clinton A. Pierce wondered about how to do the equivalent of exists
$hash{$key} in Parrot when one doesn't necessarily know the types of
the things in the hash. Leo Toetsch pointed to exists_keyed and
type_keyed. Jason Gloudon pointed out that the docs for type_keyed
referred only to PMCs, with no mention of 'primitive' types. He wondered
if PerlHash shouldn't just dictate that its contents were all PMCs.

http://makeashorterlink.com/?M62042532

  Meanwhile in Perl6-language
The language group is trying to catch up with internals in number of
posts. They managed 89 posts this week compared to internals' 96. If you
discount attachments, language probably won on volume (and it certainly
wins hands down on the `difficulty of summarization' metric).

  Draft Proposal: Declaring Classwide Attributes
The discussion of how to declare classwide attributes rumbled on from
last week; I'll just pick out a few