On Arriving at the Pearly Gates
-------------------------------
On  arriving  at the Pearly Gates, if you have been thinking and coding in a de-
clarative style, be sure to mention this to an official, who will fast-track you
through.

In  days-gone-by,  this would have made little difference.  The old wrought-iron
Gates were at the end of a winding path; atop a grassy hill; betwixt high, white
walls; under a clear, blue sky. You would just chip up; press the bell; and wait
for Saint Peter to show you in.

However, with the steady year-on-year increase in traffic, the Gate Area now re-
sembles the  immigration  hall  at  JFK;  the lines zig-zag out of sight and you
can't quite hear the announcements. You'll be glad of any little advantage.

(
    One test They use  is to see whether your end-of-line comments are predomin-
    antly noun-phrases, rather than imperatives.

        ⌽⍺      ⍝ reverse ⍺         (imperative indicates procedural thinking)
        ⌽⍵      ⍝ the reverse of ⍵  (noun phrase suggests declarative thinking)
                  ¯¯¯         ¯¯
        n←+/v   ⍝ add up v and assign it to n       (procedural)
        n←+/v   ⍝ n is the sum of the items of v    (declarative)
                    ¯¯     ¯¯¯
    Of course, you could rip through and edit your comments  but They have other
    ways ...

    They might ask you to read "m←0" aloud:

        "m gets zero"           (procedural)
        "m becomes zero"        (procedural)

        "m is zero"             (declarative)
        "m names zero"          (declarative)
        "m specifies zero"      (declarative - KEI)

    They might ask what happens when the interpreter evaluates m←0:

        "It assigns zero to m (← is a left-pointing arrow)"     (procedural)
        "It assigns m to zero (← is a right-pointing finger)"   (declarative)

    Regarding the above: at a baby-naming ceremony we (with the possible except-
    ion of some folk in the pop music industry) usually think of  assigning  the
    name to the baby, rather than the baby to the name.

    Finally:

        "APL evaluates right-to-left"                           (procedural)
        "APL functions apply to everything to their right"      (declarative)

    See: http://dfns.dyalog.com/downloads/howcomp.pdf
)

See also: declarative muson

Back to: contents

Back to: Workspaces

Trouble seeing APL font?