Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-680

RFC: New #local directive that behaves like #set but puts things into local context in macro rendering

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      It would be very useful to be able to set variables that are in local macro scope. That is, they do not overwrite "global" variables and are thrown away after macro rendering. This would allow people to build macro libraries that do not clash so easily with each other.

      There is some implementation of a "LocalDirective" in experimental/localdirective but I didn't quite get it and it doesn't follow the same syntax as #set. I used a few minutes to hack together this alternative implementation which behaves exactly like #set but it puts things in local context only.

      There's only one test case since this is Request-for-Comments type of patch.

        Attachments

        1. velocity-local-directive.patch
          9 kB
          Jarkko Viinamäki
        2. velocity-local-directive-1.1.patch
          10 kB
          Jarkko Viinamäki

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              wyla Jarkko Viinamäki
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: