Commit Graph

67 Commits (262f04db6d6f290d5c120bd613e2abb89c0ae501)

Author SHA1 Message Date
Mike Gerwitz 262f04db6d xsltexi-generated files included 2014-12-19 14:51:02 -05:00
Mike Gerwitz 6900181363 apply/ref documentation syntax corrections
These problems won't happen in the future; they were unchecked because
documentation wasn't being generated.
2014-12-19 14:51:02 -05:00
Mike Gerwitz f522a78ed1 License header @comment flag for xsltexi 2014-12-19 14:51:02 -05:00
Mike Gerwitz ae82e28cd3 xsltexi Texinfo file generation 2014-12-19 14:50:59 -05:00
Mike Gerwitz d3315bce91 Documentation syntax correction for partial.xsl docblock 2014-12-19 12:42:09 -05:00
Mike Gerwitz 587d22e2b2 GNU autotools, including doc build 2014-12-19 12:39:22 -05:00
Mike Gerwitz 0ddd0cd32a TexInfo documentation boilerplate 2014-12-19 12:39:06 -05:00
Mike Gerwitz 37ccac5f87 `f:thrush' implemented (alias of `f:thrushr')
`f:thrushl' will follow in the near future; don't you worry.
2014-12-10 15:34:48 -05:00
Mike Gerwitz 5f3e9aad1c Comment to indicate that `f:thrushl' is not yet implemented
It will be; I just do not need it at this moment and want to get other
things moving.
2014-12-10 15:31:59 -05:00
Mike Gerwitz ebc6891c3c Initial thrushing implementation
f:thrushr
2014-12-10 15:31:35 -05:00
Mike Gerwitz bb049984d5 All ref functions now have data adjacency guarantees
Accessors will ignore adjacent data and mutators will echo them, by
reference, unchanged.
2014-12-04 15:28:57 -05:00
Mike Gerwitz 0b5ed975a0 `arity/ref.xsl' documentation updated to reflect data adjacency guarantees 2014-12-04 15:27:47 -05:00
Mike Gerwitz 4c27b8d15d Assurances that all other `f:*' functions properly handle adjacent data 2014-12-04 15:27:47 -05:00
Mike Gerwitz 658edd8717 `f:set-args' respects and echoes adjacent data by references
Was previously clobbered.
2014-12-04 15:27:47 -05:00
Mike Gerwitz e93283c608 `f:args' ignores adjacent data 2014-12-04 15:27:46 -05:00
Mike Gerwitz 2760834bfb partial.xspec using `f:make-ref' instead of manual construction 2014-12-04 15:27:46 -05:00
Mike Gerwitz 09d2231fc0 `f:length' added
This is aggressively tested in every instance where it could be affected,
since any mishandling of this value would be incredibly dangerous (best
case, it would blow up and abort; worst case, data are interchanged between
refs).
2014-12-04 02:15:22 -05:00
Mike Gerwitz 4f7bb0fcef `apply-gen' partial functions now generated
This produces a short-hand partial application (well, it'd be more accurate
to call the use of `f:apply' or `f:partial' long-hand, since this is most
natural).
2014-12-04 01:14:13 -05:00
Mike Gerwitz 31aa7fa111 `apply-gen' now ingores arity-overloaded functions
Rationale is provided in `apply-gen.xsl'.
2014-12-04 01:13:24 -05:00
Mike Gerwitz e392d411fa Short-hand partial application example added to README.md 2014-12-02 16:43:05 -05:00
Mike Gerwitz bb9107c8c1 `apply-gen' now generates functions for partial applications
This is intended as a convenient shorthand:

```xml
  <!-- these two are identical -->
  <sequence select="f:apply( my:func(), $x, $y )" />
  <sequence select="my:func( $x, $y )" />
```
2014-12-02 16:05:01 -05:00
Mike Gerwitz faadaa3edd More comprehensive fnref abstraction
This will allow the implementation to evolve transparently.  And it will be
evolving.
2014-12-01 09:53:45 -05:00
Mike Gerwitz 189eb0cdd6 Partial applications now defined in terms of ref mutators 2014-12-01 09:48:45 -05:00
Mike Gerwitz c526fa2925 `f:{unshift,push}-args' added 2014-12-01 00:34:52 -05:00
Mike Gerwitz 18c1614777 `f:set-args' setter and `f:args' accessor implemented
As operations on dynamic function references become more complex, and since
evolution of the reference structure is planned to evolve, maintaining an
abstraction is vital for both grokking and maintenance.
2014-11-30 04:36:08 -05:00
Mike Gerwitz cd278c31d4 Partial applications now manipulate fnref arity
Previously, a separate `@partial' attribute was added to the ref and the
`@arity' maintained.  Unfortunately, this coupled `f:arity' with
`f:partial', which is unnecessary, considering that partial application is
supposed to conceptually yield a new function, which should be transparent
to `f:arity'.
2014-11-30 03:29:46 -05:00
Mike Gerwitz bc871435fa apply-gen now uses `f:make-ref'
We're essentailly macro-expanding the `f:make-ref' call.  :)
2014-11-30 03:28:43 -05:00
Mike Gerwitz 5857eed3d6 `arity.xsl' stylesheet combined with ref functions into `ref.xsl'
These are strongly related---they operate on the same abstraction.
2014-11-29 02:01:40 -05:00
Mike Gerwitz c64cefe931 `f:arity' now considers partial applications 2014-11-29 01:16:59 -05:00
Mike Gerwitz f62e6a8e33 Arity test case using f:make-ref
In place of manual specification.
2014-11-28 02:27:07 -05:00
Mike Gerwitz 7fd1618390 Partial dynamic function applications
This introduces support for partial applications on dynamic functions.
The test cases are comprehensive and the implementation should be
quite stable.

Even though the base higher-order function implementation was based on
the work of Dimitre Novatchev[0], I have chosen a different route for
partial application:  Novatchev's method relies on storing partially
applied arguments as nodes, together with their types.  The types are
detected the best they can be, with accuracy varying wildly depending
on whether a schema-aware processor is present.

But regardless, that method would not retain node context.

Sequences, however, do.  By using sequences, we allow the processor to
retain all type and context information perfectly without any
additional work that is inaccurate, adds complexity, and likely to
cause subtle problems.  It will also support any types that we are
unaware of.  As Novatchev mentions:

  The argument type-detection that f:curry() uses has been implemented
  only for the builtin XML Schema datatypes. It will not recognize the
  user-defined type of an argument, which can be created by an user of
  a Schema-Aware (SA) XSLT 2.0 processor.[0]

This is not a problem with hoxsl.

[0]: http://conferences.idealliance.org/extreme/html/2006/Novatchev01/EML2006Novatchev01.html
2014-11-27 01:12:17 -05:00
Mike Gerwitz 162c037508 apply-gen TODOs added to header 2014-11-27 01:11:31 -05:00
Mike Gerwitz d9f4894546 README.md updated with mention of partial applications
It does not do it much justice; documentation will come later.  The test
cases are comprehensive.
2014-11-27 01:11:31 -05:00
Mike Gerwitz a351e94910 All `f:apply' functions support partial application
'Tis tasty!
2014-11-27 01:11:30 -05:00
Mike Gerwitz 63487afa67 `f:apply' currying support
Partial application support on all the other `f:apply' functions (other
arities) will be completed in the next commit.
2014-11-27 01:11:30 -05:00
Mike Gerwitz 425f050b03 `f:apply' test case now using f:make-ref
That is, in place of manual construction.  This is especially important for
the next commit, which requires an arity datum.
2014-11-27 01:11:29 -05:00
Mike Gerwitz 33788871a9 f:make-ref, f:is-ref, and f:QName added 2014-11-27 01:11:29 -05:00
Mike Gerwitz b384e5fad1 Partial applications apply target function when all params are bound
I am aware of the Saxon 9 warning regarding multiple imports of arity.xsl;
I'm going to choose to ignore this, formally in the future.  Each of the
stylesheets is treated like a module.

Michael Kay, Saxon's author, discusses it here:

  http://stackoverflow.com/a/10102298
2014-11-27 01:11:28 -05:00
Mike Gerwitz 465ef7e8a5 Apply test case ensures arguments are passed by reference
Confidence in its application is also increased through a unique node.
2014-11-27 01:11:28 -05:00
Mike Gerwitz 0dc019c9ed Error and hook for arity count in partial application 2014-11-27 01:11:27 -05:00
Mike Gerwitz 04373b5edd f:arity extracted into its own stylesheet
It depends on partial application logic, but does not belong in partial.xsl
2014-11-27 01:11:27 -05:00
Mike Gerwitz a02865d8b1 May now partially apply partial applications 2014-11-27 01:11:26 -05:00
Mike Gerwitz 8ba1f04147 Partial application initial development
No support yet for recursive partial applications; just a basic concept.
2014-11-27 01:11:14 -05:00
Mike Gerwitz 0f2212e7d4 test/runner properly fails on xspec non-zero exit 2014-11-24 11:13:45 -05:00
Mike Gerwitz 8a204534f0 *.{out=>apply} for test case apply-gen output 2014-11-24 11:08:24 -05:00
Mike Gerwitz 1c01e765a7 Delayed function nodes now wrapped in f:ref node
This primarily allows us to type check, but will also may it easy/performant
to query more complicated structures.
2014-11-24 11:07:25 -05:00
Mike Gerwitz eb66c838c6 f:arity added for delayed functions 2014-11-22 00:17:01 -05:00
Mike Gerwitz acdacef1d7 apply-gen application template priority for good measure
Depending on import/include order is a bad idea.
2014-11-22 00:05:11 -05:00
Mike Gerwitz 01217711c4 {xslink=>hoxsl} namespace corrections
Copy-paste exposed.
2014-11-22 00:05:11 -05:00
Mike Gerwitz 1cc2423662 apply-gen now properly handles multiple functions 2014-11-22 00:05:11 -05:00