potion  0.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PNWeakRef Struct Reference

a weak ref is used for upvals, it acts as a memory slot, non-volatile but mutable. More...

#include <potion.h>

Public Member Functions

PN potion_ref (Potion *P, PN data)
 
PN potion_ref_string (Potion *P, PN cl, PN self, PN len)
 
#define PN_DEREF(x)   ((struct PNWeakRef *)(x))->data
 

Data Fields

 PN_OBJECT_HEADER
 PNType vt; PNUniq uniq. More...
 
PN data
 

Detailed Description

a weak ref is used for upvals, it acts as a memory slot, non-volatile but mutable.

Definition at line 479 of file potion.h.

Member Function Documentation

PN potion_ref ( Potion P,
PN  data 
)

PNWeakRef constructor, get or set the attached ref data

Parameters
data- non-volatile but mutable
Returns
if is_ref data returns data, else create and return a new PNWeakRef to data

Definition at line 467 of file objmodel.c.

PN potion_ref_string ( Potion P,
PN  cl,
PN  self,
PN  len 
)

"string" of a ref, a PNWeakRef object

Returns
"\<ref>"

Definition at line 477 of file objmodel.c.

Field Documentation

PNWeakRef::PN_OBJECT_HEADER

PNType vt; PNUniq uniq.

Definition at line 480 of file potion.h.

PN PNWeakRef::data

Definition at line 481 of file potion.h.


The documentation for this struct was generated from the following files: