bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Tree Traversal in gnu-apl


From: Rowan Cannaday
Subject: [Bug-apl] Tree Traversal in gnu-apl
Date: Fri, 27 Sep 2019 15:44:20 -0400

Hello y'all.

I have been attempting to learn function composition & higher-order functions in gnu-apl, and how to use it to perform tree traversal.

https://en.wikipedia.org/wiki/Function_composition_(computer_science)#APL
https://en.wikipedia.org/wiki/Higher-order_function#APL
https://rosettacode.org/wiki/Tree_traversal#APL

Unfortunately a lot of the syntax used is dyalog & dfn specific, so working out some of the examples is a bit tricky for myself.
(the main inconsistencies are '∇' as a recursive function definition, ⍺⍺ & ⍵⍵ to refer to left and right operands, '@' as the 'at' operator, '⍣' operator differences, as well as possibly others).

Has anybody done 'idiomatic' tree traversal in gnu-apl? Does anybody use primitive composition functions in their code?

Trying to figure out what works and feels natural in the language. Any examples or guidance would be appreciated.

Examples:

Higher order fns in gnu-apl:
∇Z ← (L twice) B
    Z ← L L B


∇Z ← plusthree B
    Z ← B + 3


∇Z ← g B
    Z ← plusthree twice B


reply via email to

[Prev in Thread] Current Thread [Next in Thread]