Thursday, September 15, 2011

Harbour/xharbour Diff :12/57 - MULTIVALUE MACROS by Przemyslaw Czerpak

In the early Harbour days was added basic support for multivalue macros
which can be evaluated to list of values, f.e.:
      ? &("1,2,3")
should show:
      1,  2,  3
The implementation of this extension was not accepted by many of Harbour
developers and it was one of the main reasons of the xHarbour fork.
In Harbour it was later fully removed and implemented from scratch using
different internal algorithms and structures. Now Harbour supports multivalue
macros in code like:
      proc main()
         local s1 := "'a', 'b', 'c'", s2 := "1,3", a
         ? &s1
         a := { { "|", &s1, 'x', &s2, 'y' }, 'x', &s2 }
         ? "a[1] items:"
         aeval( a[1], { |x,i| qout( i, x ) } )
         ? "a["+s2+"] =>", a[ &s2 ]
      return

xHarbour which inherited the original implementation after over 6 years
still cannot execute correctly above code.


No comments:

Post a Comment