]> git.vpit.fr Git - perl/modules/Sub-Op.git/blobdiff - README
Update VPIT::TestHelpers to 15e8aee3
[perl/modules/Sub-Op.git] / README
diff --git a/README b/README
index 4fe59d2a643fc35de44802cce20357484b13dfdd..2273fa8f1eb82ef5ad9576e3982014bdda8d0a8c 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
     Sub::Op - Install subroutines as opcodes.
 
 VERSION
-    Version 0.01
+    Version 0.02
 
 SYNOPSIS
     In your XS file :
@@ -27,11 +27,11 @@ SYNOPSIS
         BOOT:
         {
          sub_op_config_t c;
-         c.name  = "reftype";
-         c.len   = sizeof("reftype")-1;
-         c.pp    = scalar_util_reftype;
-         c.check = 0;
-         c.ud    = NULL;
+         c.name    = "reftype";
+         c.namelen = sizeof("reftype")-1;
+         c.pp      = scalar_util_reftype;
+         c.check   = 0;
+         c.ud      = NULL;
          sub_op_register(aTHX_ &c);
         }
 
@@ -98,7 +98,7 @@ C API
         The name of the subroutine you want to replace. Allowed to be
         static.
 
-    *   "STRLEN len"
+    *   "STRLEN namelen"
 
         "name"'s length, in bytes.
 
@@ -146,6 +146,17 @@ EXAMPLES
     See the t/Sub-Op-LexicalSub directory that implements a complete
     example.
 
+CAVEATS
+    Preexistent definitions of a sub whose name is handled by Sub::Op are
+    restored at the end of the lexical scope in which the module is used.
+    But if you define a sub in the scope of action of Sub::Op with a name
+    that is currently being replaced, the new declaration will be
+    obliterated at the scope end.
+
+    Function calls without parenthesis inside an "eval STRING" in the scope
+    of the pragma won't be replaced. I know a few ways of fixing this, but
+    I've not yet decided on which.
+
 DEPENDENCIES
     perl 5.10.
 
@@ -156,6 +167,11 @@ DEPENDENCIES
 SEE ALSO
     subs::auto.
 
+    B::Hooks::XSUB::CallAsOp provides a C API to declare XSUBs that
+    effectively call a specific PP function. Thus, it allows you to write
+    XSUBs with the PP stack conventions used for implementing perl core
+    keywords. There's no opcode replacement and no parsing hacks.
+
     B::Hooks::OP::Check::EntersubForCV.
 
 AUTHOR