DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11340>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11340

"Velicimacro Miscellany" example in velocity-user doc does not work with inline macros.

           Summary: "Velicimacro Miscellany" example in velocity-user doc
                    does not work with inline macros.
           Product: Velocity
           Version: 1.3-rc1
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Source
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


According to the documentation, it should be possible to use a macro in an
interpolated string passed to another macro.  However, the example given
demonstrates clearly that this does NOT work with inline macros.  The example
given is this:

  #macro( inner $foo )
    inner : $foo
  #end

  #macro( outer $foo )
    #set($bar = "outerlala")
    outer : $foo
  #end

  #set($bar = 'calltimelala')
  #outer( "#inner($bar)" )

The result according to the docs should be:

  outer: inner: outerlala

What you instead get is:

  outer : #inner(outerlala)

The macro expansion does work in the following example, where the string
evaluation is immediate:

  #set ($aref = "#inner($bar)")

The following config settings were used:

  velocimacro.permissions.allow.inline = true
  velocimacro.permissions.allow.inline.to.replace.global = true
  velocimacro.permissions.allow.inline.local.scope = true
  velocimacro.context.localscope = false

But no single change to these settings made a difference.

If the inner and outer macros are instead defined in a macro library, the
example does work.  But if the template attempts to override the "inner" macro,
it will not work (the original "inner" macro from the library will be used). 
Changing the inline.local.scope setting to false did not help.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to