Re: Character Properties

2002-10-21 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> X-Sender: [EMAIL PROTECTED] (Unverified)
> Date: Mon, 21 Oct 2002 11:37:51 -0400
> From: Dan Sugalski <[EMAIL PROTECTED]>
> X-SMTPD: qpsmtpd/0.12-dev, http://develooper.com/code/qpsmtpd/
> 
> At 11:09 PM -0600 10/20/02, Luke Palmer wrote:
> >What's the plan on having properties, or attributes (depending on how
> >far we're taking it), on individual characters in a string?  I think
> >it's an essential feature, as Lisp has shown us.  If there's an
> >argument otherwise, I'm all ears.
> 
> While they're certainly useful, I think essential's an awfully strong 
> word there. You'll note that, just off the top of my head, C, BASIC, 
> Fortran, Perl, Python, Java, Ruby, Pascal, Oberon, Modula (2 and 3), 
> Forth, Eiffel, Haskell, BLISS, C++, C#, COBOL, PL/I, APL, B, and BCPL 
> all don't do character properties/attributes.
> -- 
>  Dan

Fair enough.  Then tell me how you solve this problem: You have a text
file in a string, that the user has marked several places in.  He's
referring to words for which he wants to keep bookmarks in.  Now, he
deletes text (using substr), and we want to keep the marks relative to
the words, not their positions.  This seems easy, yet there's not
necessarily an easy way to do it.  Uh oh, violating perl philosophy :)

Ok, how about this:  Is there a reason I to?  Or should I not go
there?

Luke



Re: Character Properties

2002-10-21 Thread Dan Sugalski
At 11:09 PM -0600 10/20/02, Luke Palmer wrote:

What's the plan on having properties, or attributes (depending on how
far we're taking it), on individual characters in a string?  I think
it's an essential feature, as Lisp has shown us.  If there's an
argument otherwise, I'm all ears.


While they're certainly useful, I think essential's an awfully strong 
word there. You'll note that, just off the top of my head, C, BASIC, 
Fortran, Perl, Python, Java, Ruby, Pascal, Oberon, Modula (2 and 3), 
Forth, Eiffel, Haskell, BLISS, C++, C#, COBOL, PL/I, APL, B, and BCPL 
all don't do character properties/attributes.
--
Dan

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


Re: Character Properties

2002-10-21 Thread Jonathan Scott Duff
On Mon, Oct 21, 2002 at 02:20:56PM -0600, Luke Palmer wrote:
> Fair enough.  Then tell me how you solve this problem: You have a text
> file in a string, that the user has marked several places in.  He's
> referring to words for which he wants to keep bookmarks in.  Now, he
> deletes text (using substr), and we want to keep the marks relative to
> the words, not their positions.  This seems easy, yet there's not
> necessarily an easy way to do it.  Uh oh, violating perl philosophy :)

Sounds like a good candidate for modulehood.

> Ok, how about this:  Is there a reason I to?  Or should I not go
> there?

Off hand, it sounds expensive. I don't see a way to only let the people
who use it incur the penalty, but my vision isn't the best in the world.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]



RE: Character Properties

2002-10-21 Thread David Whipp
Jonathan Scott Duff wrote:
> > Ok, how about this:  Is there a reason I to?  Or 
> > should I not go there?
> 
> Off hand, it sounds expensive. I don't see a way to only let 
> the people who use it incur the penalty, but my vision isn't
> the best in the world.

It should be possible to define the bookmark methods on the basic string
class to rebless the object onto a more powerful subclass. This way, there
is no overhead until the extra information is actually attached. (bless, not
copy, because there may be other references to the string).

Dave.



Re: Character Properties

2002-10-21 Thread Dan Sugalski
At 10:53 AM -0700 10/21/02, Austin Hastings wrote:

Yeah, but emacs isn't written in any of those languages.


What, you're using emacs as an argument *for* something? :-P

And, FWIW, emacs is written in C. Granted a much macro-mutated 
version of C, but C nonetheless.

--- Dan Sugalski <[EMAIL PROTECTED]> wrote:

 At 11:09 PM -0600 10/20/02, Luke Palmer wrote:
 >What's the plan on having properties, or attributes (depending on
 how
 >far we're taking it), on individual characters in a string?  I think
 >it's an essential feature, as Lisp has shown us.  If there's an
 >argument otherwise, I'm all ears.

 While they're certainly useful, I think essential's an awfully strong

 word there. You'll note that, just off the top of my head, C, BASIC,
 Fortran, Perl, Python, Java, Ruby, Pascal, Oberon, Modula (2 and 3),
 Forth, Eiffel, Haskell, BLISS, C++, C#, COBOL, PL/I, APL, B, and BCPL


 > all don't do character properties/attributes.


--
Dan

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



Re: Character Properties

2002-10-21 Thread Simon Cozens
[EMAIL PROTECTED] (David Whipp) writes:
> It should be possible to define the bookmark methods on the basic string
> class to rebless the object onto a more powerful subclass. 

That makes it a doubly good candidate for modulehood.

-- 
It's 106 miles from Birmingham, we've got an eighth of a tank of gas,
half a pack of Dorritos, it's dusk, and we're wearing contacts.
- Malcolm Ray



Re: Character Properties

2002-10-21 Thread Dan Sugalski
At 2:20 PM -0600 10/21/02, Luke Palmer wrote:

 > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm

 X-Sender: [EMAIL PROTECTED] (Unverified)
 Date: Mon, 21 Oct 2002 11:37:51 -0400
 From: Dan Sugalski <[EMAIL PROTECTED]>
 X-SMTPD: qpsmtpd/0.12-dev, http://develooper.com/code/qpsmtpd/

 At 11:09 PM -0600 10/20/02, Luke Palmer wrote:
 >What's the plan on having properties, or attributes (depending on how
 >far we're taking it), on individual characters in a string?  I think
 >it's an essential feature, as Lisp has shown us.  If there's an
 >argument otherwise, I'm all ears.

 While they're certainly useful, I think essential's an awfully strong
 word there. You'll note that, just off the top of my head, C, BASIC,
 Fortran, Perl, Python, Java, Ruby, Pascal, Oberon, Modula (2 and 3),
 Forth, Eiffel, Haskell, BLISS, C++, C#, COBOL, PL/I, APL, B, and BCPL

 > all don't do character properties/attributes.

Fair enough.  Then tell me how you solve this problem: You have a text
file in a string, that the user has marked several places in.  He's
referring to words for which he wants to keep bookmarks in.  Now, he
deletes text (using substr), and we want to keep the marks relative to
the words, not their positions.  This seems easy, yet there's not
necessarily an easy way to do it.  Uh oh, violating perl philosophy :)


I didn't call the problem unreasonable, I was objecting to its 
characterization as an "essential feature". It isn't. A useful thing, 
definitely, but there are a lot of those. It's hardly essential any 
more than, say, a hash that automagically maps to the current 
directory's files (iteratively, of course, catching all the 
subdirectories) is essential

While perl is a language that makes it easy to do useful things, it 
doesn't mean that all useful things should be easy to do in perl. 
Given how large the set of Useful Things is, that's not unreasonable.
--
Dan

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


Re: Character Properties

2002-10-21 Thread Dan Sugalski
At 7:22 PM + 10/21/02, Rafael Garcia-Suarez wrote:

Dan Sugalski wrote :


 And, FWIW, emacs is written in C. Granted a much macro-mutated
 version of C, but C nonetheless.


Just like Perl 5 ;-)


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

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


Re: Character Properties

2002-10-21 Thread Luke Palmer
> I didn't call the problem unreasonable, I was objecting to its 
> characterization as an "essential feature". It isn't. A useful thing, 
> definitely, but there are a lot of those. It's hardly essential any 
> more than, say, a hash that automagically maps to the current 
> directory's files (iteratively, of course, catching all the 
> subdirectories) is essential

I see what you mean now.  I had A Momentary Lapse of Reason, in which
I forgot modules could do such things.  It's very suited to a
module---not very common, but very important to certain problems.

Luke



Re: Character Properties

2002-10-21 Thread Rafael Garcia-Suarez
Dan Sugalski wrote :
> 
> And, FWIW, emacs is written in C. Granted a much macro-mutated 
> version of C, but C nonetheless.

Just like Perl 5 ;-)



[ANNOUNCE] POOC v0.2

2002-10-21 Thread Michael Lazzaro
The Perl6 OO Cookbook, v0.2 is online.

	http://cog.cognitivity.com/perl6/


Changes include:

[] *Much* better accuracy in most of the early recipes (better matching 
to Apos/Exes and perl6-language: see the 'Status' fields of each 
recipe.)  More fixes coming very soon.

[] Ability to annotate sections and recipes w/ 
discussion/comments/questions

[] Ability for the community to 'rate' each recipe for (1) general 
importance of the problem presented and (2) acceptability of the 
solution presented.

[] A new section on assertions/invariants (no solutions, only problems 
:-D)

For more info, see the new About/Contribute/Preface pages.

--

For those of you who haven't yet visited, the goal of the POOC is (at 
the moment) less to give Solutions (because most haven't been decided 
yet) than to compile the full and complete list of Problems that 
solutions will eventually be shoved into.  It represents "all the 
questions that someone is likely to ask" when being introduced to perl6 
OO.  There are 106 recipes so far.

The interactive features are experimental.  They're in there to 
encourage community discussion, and because they were easy to do (I'll 
tweak them as needed).  There are many people out there who don't have 
the time or ability to help the perl6 programming efforts directly, but 
who still are intensely interested in the process; this represents one 
simple way of contributing.

1) Ratings

I am hoping that the general community will help out by 'rating' each 
problem and solution.

By giving a Problem a high rating, you're saying that a one-line 
solution to the problem is critically important to you.  A low rating 
means you don't particularly care if perl6 even _supports_ a solution 
to the problem.

By giving a Solution a high rating, you're saying that if that's the 
way perl6 actually solves the problem, you'd be thrilled.  A low rating 
means you'd never remember the solution or syntax in a million years, 
and would need it stapled to your forehead if you actually wanted to 
use that feature.

2) Comments/Annotations

A place exists in every section and recipe for comments, questions, 
objections, corrections, or general discussion.  Use this to give 
feedback or ask/answer questions when you don't want to clutter up the 
mailing lists.

--

For reference, in the first week the POOC had been visited by at least 
550+ unique individuals, logging thousands of individual visits.  Not 
bad, I think.

MikeL