Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Perl 6: Static/Dynamic Strong/Weak Type Systems

by dragonchild (Archbishop)
on Apr 16, 2006 at 21:29 UTC ( [id://543702]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl 6: Static/Dynamic Strong/Weak Type Systems
in thread Perl 6: Static/Dynamic Strong/Weak Type Systems

That just means it doesn't distinguish between types you feel are important. Strong vs. Weak typing has to do with how easy it is to coerce various types into one another. There are very specific types in Perl.
  • Scalar
  • Hash
  • Array
  • Subroutine
  • Glob
  • Format

While you may be able to extract a scalar from an array and an array has a meaning within scalar context, that doesn't mean you can coerce the array into the scalar. Try doing any sort of meaningful work converting between formats and subroutines.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re^2: Perl 6: Static/Dynamic Strong/Weak Type Systems

Replies are listed 'Best First'.
Re^3: Perl 6: Static/Dynamic Strong/Weak Type Systems
by salva (Canon) on Apr 16, 2006 at 21:57 UTC
    there is a hole:
    use Devel::Peek; $foo = *foo; Dump($foo);
      Fair enough. For those who don't follow, the "hole" is that whenever an explicit glob is the RHS of an assignment, the member of the glob matching the LHS will be substituted. This is because a glob is both a type and a collection of types.

      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
        no, no, what I wanted to show is that when a glob ia assigned to a scalar, the scalar becomes a glob!

        After

        $foo = *foo
        $foo is a glob!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found