On 04-Jul-2001 Rocco Caputo wrote:
> On Tue, Jul 03, 2001 at 11:54:42PM -0400, [EMAIL PROTECTED] wrote:
>> 
>> On 29-Jun-2001 Rocco Caputo wrote:
>> > URI style isn't transparent.  Ideally, a program shouldn't need to
>> > know whether it's talking to a poe thingy or a stem thingy, so
>> > everything up to the colon gets in the way.
> 
> Yeah! I agree! With myself! Me too!

Yeah, i kinda agree with this too.  Only the routing component should
know if it's a POE session or JAAS object or Stem Hub.

>> > I'm partial to kernel/session/event, where kernel/ and kernel/session
>> > can just be left off if they're not needed:
>> > 
>> >   kernel/session/event
>> >   session/event
>> >   event
>> 
>> Given a plain scallar, taken out of context (say in the doco, or in
>> email,
>> or in a tuple-space), how do you tell if it's a session, kernel or
>> event?
>> 
>>         session/
>>         kernel//
> 
> No kernel or event mentioned:
>         "/session/"
> 
> No session or event mentioned:
>         "kernel//"
> 
> Same as yield:
>         "//" or just ""
> 
> Machines can read it; why can't people?  I understand, though: at
> first glance, the reader's got to do a little more thinking.
> Positional fields suck, especially when paths like that get long (just
> what does "/milkyway/sol/earth/n-america/dngor//" mean?).  

Well, if/when we get clouds of POE kernels and Stem Hubs and DRuby
whatzits, "longer range" routing will be needed.  Or maybe not, if we say
that the routing layer has to take care of it

> That's a
> point scored for that ugly "/tag=value/tag=value" format.

X.500-like.  LDAP uses it too.  I've kind of warmed to it... mind you, if
I had to live with it for a long time, maybe i wouldn't...
 
> Anyway, here's how it's parsed.  Mind you, I just woke up and this is
> just a little better than pseudocode.

I'll say :)
 
> sub parse_address {
>   my $address = shift;
        # should be enough :)
        my ($kernel, $session, $event)=split /\//, $address;
>
>   # Empty fields are filled in with current defaults.
>   $kernel  ||= $my_kernel;
>   $session ||= $my_session;
>   $event   ||= $my_event;
>
>   # Do whatever with it.
>   ...;
> }

Also, I feel we also need to specify the regex that each part can match.

$kernel =~ /^([-.\w:]+)$/;
$session =~ /^([\w]+)$/;
$event =~ /^([\w]+)$/

Maybe we should use a-zA-Z0-9_ instead of \w, so that locale doesn't
affect this.

>> IHNJ, IJLS BANG PATH
> 
> Bang! Path! Bang! Path! Bang! Path! Bang! Path! Smock! Smock! Smock!

PONY PONY PONY

-Philip

Reply via email to