Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: Perl 5 interpreter

by Anonymous Monk
on Jan 12, 2011 at 08:35 UTC ( [id://881841]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl 5 interpreter
in thread Perl 5 interpreter

But there are so many macros that just replace one name with the same name with things like S_ or PL_ infront of it. I couldn't figure out why such a thing was needed.

Also at times variable types like int, char and other terms like like volatile have been custom names through macros. Couldn't understand why that was done.

Replies are listed 'Best First'.
Re^5: Perl 5 interpreter
by Corion (Patriarch) on Jan 12, 2011 at 08:43 UTC

    The custom renaming to S_ or PL_ comes from C having no namespaces and Perl being embeddable into other applications. There you need to fake a namespace by prefixing all exported symbols with whatever you need.

    In theory, ideally, Perl C code wouldn't use int or char at all, but either Perl-internal data types like SV (which can hold an int) or whatever Perl defines to be the data type for holding integral numbers (UINT ?) or string length (SvLENGTH ?). Of course, at the boundary to the C library, you won't get around actually touching native data types.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found