develooper Front page | perl.perl6.language | Postings from June 2006

[svn:perl6-synopsis] r9720 - doc/trunk/design/syn

From:
audreyt
Date:
June 28, 2006 18:44
Subject:
[svn:perl6-synopsis] r9720 - doc/trunk/design/syn
Message ID:
20060629014352.10D1DD0257@x12.develooper.com
Author: audreyt
Date: Wed Jun 28 18:43:52 2006
New Revision: 9720

Modified:
   doc/trunk/design/syn/S06.pod

Log:
* S06: Macros now re-splice in runtime when called as functions;
  this closes the unspecced "taking &macro as an object and call it"
  loophole in S06.

Modified: doc/trunk/design/syn/S06.pod
==============================================================================
--- doc/trunk/design/syn/S06.pod	(original)
+++ doc/trunk/design/syn/S06.pod	Wed Jun 28 18:43:52 2006
@@ -2158,6 +2158,15 @@
 original language and know which parts of the derived program come
 from which parts of the user's view of the program.
 
+If you call a macro at runtime, the result of the macro is automatically
+evaluated again, so the two calls below prints the same thing:
+
+    macro f { '1 + 1' }
+    say f();    # compile-time call to &f
+    say &f();   # runtime call to &f
+
+=head2 Quasiquoting
+
 In aid of returning syntax tree, Perl provides a "quasiquoting"
 mechanism using the quote C<q:code>, followed by a block intended to
 represent an AST:



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