Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: strong typing

by jdporter (Paladin)
on Dec 15, 2004 at 15:17 UTC ( [id://415061]=note: print w/replies, xml ) Need Help??


in reply to Re^3: strong typing
in thread (Completely OT) - Hero(i)n programming language on Slashdot

Perl's type system has no concept of "integer", "boolean", etc.--it only knows about scalars...
But that isn't entirely true:
print 5 == "foo"; Argument "foo" isn't numeric in numeric eq (==)

The fact that these types are checked/enforced at run time rather than compile time doesn't mean they aren't types. It's called dynamic typing.

Replies are listed 'Best First'.
Re^5: strong typing
by chromatic (Archbishop) on Dec 16, 2004 at 00:14 UTC

    Those aren't types in Perl. Those are values.

      Huh? You're saying numeric is a value? No. It's a type. Values have types. It's the type of "foo" that perl is complaining about, not its value.

        Containers have types in Perl. Values don't. That's how (I say) Perl's type system works.

        (Okay, that's not entirely true, but if you need gory details, look in sv.h and Devel::Peek. My point is that Perl doesn't expose the types of values to users.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2024-03-28 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found