Re: ./method

2005-06-21 Thread Matthew Zimmerman

Juerd wrote:

What does this have to do with perl6-internals? F-up to p6l.


Sorry! Typing faster than my brain is working. Resent to the right list.


If I have a complicated mathematical expression


If you have anything that is complicated, a verbose version should
always be considered, if only to avoid getting lost in punctuation. This
is not specific to ./foo in any way.


If I'm calling a method on $?SELF five times in a statement and you're 
only calling one once, wouldn't such an operator be more important to me 
than to you?


I'm not arguing that having a short way to call a method on the current 
invocant-- be it operator or keyword-- is a bad thing. It's a great 
feature, and why I'm delurking to comment on this. If 'o.' really 
doesn't work, it doesn't work. We could pick a different operator. I'm 
just saying that the particular choice of './' doesn't work for me (and 
evidently a number of other people).



It is visually much more suited for action than functional use:

./foo($bar, $baz);  # beautiful

print 5 + ./foo($bar);  # ugly



Right here, in my mind, is an argument against it. I'd end up using the 
operator in some places and not others, because in some contexts it'd be 
"ugly" and others "beautiful". Thus further reducing the visual 
consistency of the code. I haven't yet given up on the idea that there's 
a shortened operator that would be more universally readable.


at the top of my code if I have to, but I want to make one last gasp at 
getting $Larry / @Larry to reconsider this.


I find "o." absolutily horrifying. But then, that's apparently how you
think of "./", so we have to trust Larry's decision on this. I don't
think further discussing this is really fruitful, as it has already been
discussed more than is good for us.


Fair point. I mean no offense, nor do I wish to beat a dead horse. I 
just want to make sure it's dead, instead of merely resting.


--
  Matt

  Matthew Zimmerman
  Interdisciplinary Biophysics, University of Virginia
  http://www.people.virginia.edu/~mdz4c/


Re: ./method

2005-06-21 Thread Matthew Zimmerman

[Sorry, sent this to the wrong list by mistake.]

Matthew Zimmerman wrote:

Juerd wrote:


Kurt skribis 2005-06-20 19:46 (-0400):


On 6/20/05, Juerd wrote:


Or you can just get your "self" with a simple (module that does)
   macro self () { '$?SELF' }



And you could do the same for `./`.




Certainly.

However, there has proven to be much demand for something like ./method,
and in such cases, having it by default is probably the best thing.

I personally don't think it's either necessary or too much. I care about
.method using $_, and many other people care about having short syntax
for self.method too. ./method was something that would work for me, so I
shared that idea, and it was generally accepted.

Apart from the personal joy of seeing something I invented become part
of the official language, I don't really care if ./method is eventually
part of Perl 6 or not. I have always named my invocants, and don't mind
continue to do so. On the other hand, if there is a shorthand, I will
use it, because regardless of whether you think it's pretty or ugly, and
regardless of whether you think it looks enough like a method call,
having a short two character operator for this is in fact very
convenient.



Could we revisit the idea of using a shorter keyword for $?SELF, like 
'o'? I know that $Larry said the idea was "probably" not going to work:


  http://tinyurl.com/7baz6

but I'm curious if the reasoning that killed it then still holds now, 
now that './' has emerged as a replacement.


Count me among the './' dissenters, too. The virtual explosion of new 
operators in Perl 6 has not concerned me too much, as I don't envision 
myself using many of them, but the operation that './' does is something 
I do very frequently. I'm just imaging a lot of my Perl 5 code like:


   if ( $self->unit_id == $s2->unit_id ) {
$self->add_component(
 $self->_fraction * $self->concentration +
 $s2->_fraction * $s2->concentration
);
$self->update;
   }

replaced with:

   if ( $.unit_id = $s2.unit_id ) {
./add_component(
./:fraction * ./concentration +
$s2.:fraction * $s2.concentration
   );
./update;
   }

and it gives me the willies. If I have a complicated mathematical 
expression with method calls in it (which happens a lot for me), the '/' 
part of './' in particular gives me lots of visual problems.


I'll put

   macro o () { '$?SELF' }

at the top of my code if I have to, but I want to make one last gasp at 
getting $Larry / @Larry to reconsider this.





--
  Matt

  Matthew Zimmerman
  Interdisciplinary Biophysics, University of Virginia
  http://www.people.virginia.edu/~mdz4c/


Re: UTF-8 and Unicode FAQ, demos

2002-11-01 Thread Matthew Zimmerman
Larry has been consistently using

OxAB op 0xBB

in his messages to represent a (French quote) hyperop,
(corresponding to the Unicode characters 0x00AB and 0x00BB)
which is consistent with the iso-8859-1 encoding (despite
the fact that my mailserver or his mailer insists on
labelling those messages as UTF-8).

However, the UTF-8 encoding of those Unicode characters
actually is:

0xC2AB op 0xC2BB

.. As far as I understand it, the UTF-8 encoding only allows
single byte representations of characters if they fall in the
0x00 to 0x7F range.

So the question is, if I'm writing a program and I actually
want to use one of these ops, do I put

0xAB op 0xBB

or

0xC2AB op 0xC2BB

?

-- Matt,
   who'd never thought he'd have to do hex dumps to debug
   his Perl programs ;)

-- 
  Matthew Zimmerman
  Interdisciplinary Biophysics, University of Virginia
  http://www.people.virginia.edu/~mdz4c/



Re: UTF-8 and Unicode FAQ, demos

2002-11-02 Thread Matthew Zimmerman
On 2002.11.01 19:06 Simon Cozens wrote:
> More and more conversations like this, (and how many have we seen here
> already?) about characters sets, encodings, mail quoting issues, in
> fact, anything other than Perl, will be rife on every Perl-related
> mailing list if we persist with this idiotic idea of having Unicode
> operators.

I don't really want Unicode operators either, but if it is decided that
there will be such operators, I would still _want_to_know_how_to_use_them_.

So let me make my original question a little more general: are Perl 6 source
files encoded in Latin-1, UTF-8, or will Perl 6 provide some sort of
translation mechanism, like specifying the charset on the command line?

-- 
  Matt

      Matthew Zimmerman
  Interdisciplinary Biophysics, University of Virginia
  http://www.people.virginia.edu/~mdz4c/



Re: UTF-8 and Unicode FAQ, demos

2002-11-04 Thread Matthew Zimmerman
On Sun, Nov 03, 2002 at 09:41:44AM -, Rafael Garcia-Suarez wrote:
> Matthew Zimmerman wrote in perl.perl6.language :
> >
> > So let me make my original question a little more
> > general: are Perl 6 source files encoded in Latin-1,
> > UTF-8, or will Perl 6 provide some sort of translation
> > mechanism, like specifying the charset on the command
> > line?
>
> I expect probably something similar to Perl 5's encoding
> pragma. (But hopefully lexically scoped.)

Okay, but what will the default be? UTF-8? iso-8859-1? My
current locale? Am I going to have put

use encoding 'utf8';   # or whatever the P6 syntax will be

at the beginning of every program that might get distributed
outside of my home country to make sure it'll run? Are we 
going to tell newbies to make sure they have '-w' and 'use
strict' *and* 'use encoding' at the beginning of their programs?

I'm just worried about the possibility of writing Perl 6
programs and then sending them to friends in other parts
of the world and having them fail in subtle ways because
my Perl 6 expects 0xAB and theirs expects 0xC2AB (or visa
versa). Or if I post a code sample to CLPM that runs on
my machine that doesn't compile from the posting because
my news client automatically converts charsets. 

Undoubtedly the Perl 6 parser will be smart enough to
figure out all of this, and I'm making a mountain out of a
molehill. But I just want to make sure that one of the
people in authority here either is or will be thinking
about this.
-- 
  Matt

  Matthew Zimmerman
  Interdisciplinary Biophysics, University of Virginia
  http://www.people.virginia.edu/~mdz4c/



Re: UTF-8 and Unicode FAQ, demos

2002-11-05 Thread Matthew Zimmerman
On Mon, Nov 04, 2002 at 12:26:56PM -0800, Austin Hastings wrote:
> 
> > Of course, I also think I'm allowed to be a little inconsistent in
> > forcing things like ?op? on people.  After all, there's gotta be
> > some advantage to being the Fearless Leader...
> 
> Which kind of begs the question: Who are you? And can you authenticate
> that which you just implicitly claimed? (See quote header, above, if
> you don't understand my question)

That message got cc:'ed to me, and according to the headers I
got, somebody either cracked 'wall.org' or that's the real Larry.
Looks like he just switched to mutt and has a little bit of
config tweaking yet to do. ;)

-- 
  Matt

  Matthew Zimmerman
  Interdisciplinary Biophysics, University of Virginia
  http://www.people.virginia.edu/~mdz4c/