develooper Front page | perl.perl5.porters | Postings from October 2002

Re: Hash::Util::lock_keys inhibits bless

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
October 2, 2002 08:41
Subject:
Re: Hash::Util::lock_keys inhibits bless
Message ID:
20021002164148.B12196@plum.flirble.org
On Wed, Oct 02, 2002 at 04:35:14PM +0100, hv@crypt.org wrote:
> Currently, you can't bless anything marked as readonly. That's a nice
> clean concept, and I'd rather not add exceptions to it.
> 
> I'd be happier adding a more specific error message for this case,
> but that's going to get confusing if at some point in the future
> we may also set hashes readonly for some other reason.

I agree with both points. I'd prefer it if the restricted hashes were
marked by some flag other than read only.

Of the SV flags:

#define SVs_PADBUSY	0x00000100	/* reserved for tmp or my already */
#define SVs_PADTMP	0x00000200	/* in use as tmp */
#define SVs_PADMY	0x00000400	/* in use a "my" variable */
#define SVs_TEMP	0x00000800	/* string is stealable? */
#define SVs_OBJECT	0x00001000	/* is "blessed" */
#define SVs_GMG		0x00002000	/* has magical get method */
#define SVs_SMG		0x00004000	/* has magical set method */
#define SVs_RMG		0x00008000	/* has random magical methods */

#define SVf_IOK		0x00010000	/* has valid public integer value */
#define SVf_NOK		0x00020000	/* has valid public numeric value */
#define SVf_POK		0x00040000	/* has valid public pointer value */
#define SVf_ROK		0x00080000	/* has a valid reference pointer */

#define SVf_FAKE	0x00100000	/* glob or lexical is just a copy */
#define SVf_OOK		0x00200000	/* has valid offset value */
#define SVf_BREAK	0x00400000	/* refcnt is artificially low - used
					 * by SV's in final arena  cleanup */
#define SVf_READONLY	0x00800000	/* may not be modified */


#define SVp_IOK		0x01000000	/* has valid non-public integer value */
#define SVp_NOK		0x02000000	/* has valid non-public numeric value */
#define SVp_POK		0x04000000	/* has valid non-public pointer value */
#define SVp_SCREAM	0x08000000	/* has been studied? */

#define SVf_UTF8        0x20000000      /* SvPV is UTF-8 encoded */

#define SVf_AMAGIC	0x10000000      /* has magical overloaded methods */


how many are only used for SVs, and how many for AVs, HVs (and anything else
derived from SVs that I don't know about) ?

So can we split the flags conceptually into general flags, and flags that
are SV specific (so that the same bits can be used to mean something HV
specific) ?

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About