--- Dave Whipp <[EMAIL PROTECTED]> wrote:

> We seem happy to structure objects (using
> attributes, etc.), but verbs remain flat and uninteresting: just
> arbitrary names.
> 
> As a result of this lack of expressiveness in the grammar, we find
> ourselves saying that if a concept doesn't fit the "everything 
> is an object" worldview, then it needs to be a built-in. 

This is a good point.

I think that to a certain extent, this can be handled with properties.
It's just that we haven't gotten used to thinking this way, yet.

Already we've borrowed the Spanish ser/estar model (is/but) to
differentiate between permanent and transient characteristics. 
(Then I unpacked my adjectives... He was a hairy bear. He was a scary
bear...)

Prepositions are kind-of-there with properties, and with the
specially-named-blocks (first, last, etc.) for order-prepositions.

The cat sat on the TV.
The cat sat near the TV.
The cat sat beside the TV.
The @#$@#$ cat sat in front of the TV.

Currently, that's going to be 

$cat.sit($TV);
$cat.sit($TV but 'near');
$cat.sit($TV but 'beside');
and:
$cat = $cat but '@#$@#$'; 
$cat.sit($TV but 'in front of');

Some adverbial work has been put into blocks-as-arguments, as with sort
(sort these *ascendingly*). But in general, adverbs aren't obviously
there, yet.

(Lolly Lolly Lolly, get your adverbs here!
Quickly quickly quickly, get your adverbs here!
Slowly surely really, learn your adverbs here!)

Another use of adverbs is as intensifiers.

$x = 'useless' but 'necessary';
$y = but very 'necessary'; # How do you say this, really?
$z = but very very 'necessary';

If there were some (automatic) mechanism that ordered objects according
to their necessity (like the new part() built-in!!), the intensifiers
should affect the order:

sub do_stuff(@honeydew)
{
  my (@a, @b, @c) = part 
  { 
     when necessary ; 
      default        ;
      when optional is reversed; #? syntax
  } @honeydew;

  do_list(@a);
  do_list(@b);
  do_list(@c);
}

Ideally, the @a list and the @c list should honor the intensifiers and
be ordered such that the very-very necessary come before the very
necessary come before the necessary come before the not-very ...

Likewise, adverbs as verb modifiers provides a way to avoid having
several functions with similar behaviors. 

C<sort> does this with a block: cool. But adverbs like securely,
surely, quickly, and dynamically don't necessarily translate well to
blocks, and they don't set context.

Perhaps we need adverbial scope?

  # From LWP
  # Pass request to the user agent and get a response back
  my $res = $ua->request($req) securely; 

  ... somewhere in the bowels of LWP6? ...
    my $pcl = "http";
    when securely { $pcl = "https" };

Thus anyone could "suggest" behavior, and it may-or-may-not be acted
upon in the subsequent code. But the overall activity (the verb, which
is to say the subs/methods) gets done, regardless.

Ideas?

=Austin



Reply via email to