Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re (tilly) 1: Apocalypse 3

by TheDamian (Vicar)
on Oct 05, 2001 at 12:19 UTC ( [id://116939]=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 1: Apocalypse 3
in thread Apocalypse 3

I'm afraid := isn't the fully fledged unification operator you're hoping for. As I'll explain in Exegesis 3, it's really just an aliasing mechanism.

So your declarative emergent $x and $y values aren't actually being declared, or emerging either. :-(

In fact, you'd just get $x aliased to the (constant) result of $y+5 (which will be 5 if there's no prior assignment to $y), and then $y aliased to the (constant) result of $x-3 (which will be 2 under the previous assumption).

However, as a consolation prize for having suggested human sacrifice to me (you did intend it to be a human burnt offering, didn't you???), I have now added a Data::Unification module to my ToDo list. ;-)

Damian

Replies are listed 'Best First'.
Re: Re: Re (tilly) 1: Apocalypse 3
by $code or die (Deacon) on Oct 06, 2001 at 07:01 UTC
    Hi Damian,

    In the Section "Applied Laziness 101" of the third Exegesis, you wrote:
    Of course, if we'd written:

    my ($name, $vers, $status, $costs, @and_the_rest) = <fh>;

    The the entire file would have been read
    Did you mean:

    my ($name, $vers, $status, $costs, *@and_the_rest) = <fh>;

    or will array assignment work differently on the diamond operator?

    Simon Flack ($code or die)
    $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
    =~y'_"' ';eval"die";print $_,lc substr$@,0,3;
      Did you mean:
      my ($name, $vers, $status, $costs, *@and_the_rest) = <fh>;


      No. I did mean just what I wrote.

      Regular = assignments have the same "slurp-it-all-up" semantics as in Perl 5.

      The flattening asterisk is only required in subroutine parameter lists or := bindings.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://116939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-26 02:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found