Wikipedia article on APL has come of age!
  Home FAQ Contact Sign in
comp.lang.functional only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.functional Profile…
 Up
Wikipedia article on APL has come of age!         


Author: xahlee
Date: Aug 19, 2008 13:51

Wikipedia article on APL has come of age!
http://en.wikipedia.org/wiki/APL_(programming_language)

See also:

Conway's Game of Life in one line of APL
By 2005 Michael Gertelman
http://catpad.net/michael/apl/

btw, has anyone used apl mode in emacs? it doesn't seems to be bundled
at least.

Xah
http://xahlee.org/

11 Comments
Re: Wikipedia article on APL has come of age!         


Author: xahlee
Date: Aug 19, 2008 14:24

according to
http://en.wikipedia.org/wiki/APL_(programming_language)

quote:
«As APL has many nonstandard primitives (functions and operators,
indicated by a single symbol or a combination of a few symbols), it
does not have function or operator precedence.»

that cant be true, since function is a broad conception that includes
any operators.

But my question is about the statement that APL doesn't have operator
precedence. As far as i know, in linear textual languages (as opposed
to spread sheets, visual langs etc), unless it uses nested functional
notation (e.g. Mathematica, lisp), i can't see how it can do without
operator precedence?

For example, in Wikipedia this code example for picking 6 random
numbers from 1 to 40:

↑6?40

certainly there's operator precedence. e.g.
Show full article (1.44Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Author: Stuart McGraw
Date: Aug 19, 2008 15:09

xahlee@gmail.com wrote:
> according to
> http://en.wikipedia.org/wiki/APL_(programming_language)
>
> quote:
> «As APL has many nonstandard primitives (functions and operators,
> indicated by a single symbol or a combination of a few symbols), it
> does not have function or operator precedence.»
>
> that cant be true, since function is a broad conception that includes
> any operators.
>
> But my question is about the statement that APL doesn't have operator
> precedence. As far as i know, in linear textual languages (as opposed
> to spread sheets, visual langs etc), unless it uses nested functional
> notation (e.g. Mathematica, lisp), i can't see how it can do without
> operator precedence?
>[...]
> So i think the Wikipedia statement “it does not have function or
> operator precedence” is wrong or needs qualifications. ...
Show full article (1.28Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Author: xahlee
Date: Aug 19, 2008 15:11

On Aug 19, 3:09 pm, Stuart McGraw acedialup.com> wrote:
> xah...@gmail.com wrote:
>> according to
>>http://en.wikipedia.org/wiki/APL_(programming_language)
>
>> quote:
>> «As APL has many nonstandard primitives (functions and operators,
>> indicated by a single symbol or a combination of a few symbols), it
>> does not have function or operator precedence.»
>
>> that cant be true, since function is a broad conception that includes
>> any operators.
>
>> But my question is about the statement that APL doesn't have operator
>> precedence. As far as i know, in linear textual languages (as opposed
>> to spread sheets, visual langs etc), unless it uses nested functional
>> notation (e.g. Mathematica, lisp), i can't see how it can do without
>> operator precedence?
>>[...]
>> So i think the Wikipedia statement “it does not have function or ...
Show full article (1.58Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Author: xahlee
Date: Aug 19, 2008 15:19

On Aug 19, 3:09 pm, Stuart McGraw acedialup.com> wrote:
Show full article (0.90Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Date: Aug 19, 2008 16:08

xahlee@gmail.com wrote:
> On Aug 19, 3:09 pm, Stuart McGraw acedialup.com> wrote:
>
>>> So i think the Wikipedia statement “it does not have function or
>>> operator precedence” is wrong or needs qualifications.
>> It's been a while since I used APL but my recollection
>> is that operator precedence is very simple: left-to-right (*).
>> That is:
>>
>> a op1 b op2 c op3 d
>>
>> is parsed as:
>>
>> (a op1 (b op2 (c op3 d)))
>>
>> So I think the correct thing to say is that all APL
>> operators have the same precedence and are right-associative.
>>
>> (*) I may be mis-remembering and operators are left-
>> associative but I am pretty sure about the equal precedence ...
Show full article (1.45Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Author: xahlee
Date: Aug 19, 2008 16:26

On Aug 19, 4:08 pm, Bakul Shah bitblocks.com> wrote:
> ...
> They say it has no precedence rules because you parse from left to
> right. A monadic function grabs the result of *everything* to its
> right. A dyadic function grabs the result of everything to its right
> and the item on its left. Use parentheses when the left operand is
> to be computed from an expression. So for example you can do
> (2 × 3) + 4 × 5
> and get 26. (× is the multiply function).

That still does not explain fully how binary operation works without
precedence. For example

(2 × 3) + 4 × 5

becomes

6 + 4 × 5

But now, is it
6 + (4 × 5)
or
(6 + 4) × 5
?
Show full article (1.06Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Author: xahlee
Date: Aug 19, 2008 16:41

On Aug 19, 4:26 pm, "xah...@gmail.com" gmail.com> wrote:
> On Aug 19, 4:08 pm, Bakul Shah bitblocks.com> wrote:
>
>> ...
>> They say it has no precedence rules because you parse from left to
>> right. A monadic function grabs the result of *everything* to its
>> right. A dyadic function grabs the result of everything to its right
>> and the item on its left. Use parentheses when the left operand is
>> to be computed from an expression. So for example you can do
>> (2 × 3) + 4 × 5
>> and get 26. (× is the multiply function).

damn, post too past again.

Ok, summarizing posts in thread, it seems to be this:

in APL, there's uninary and binary operators.
When uninary operator are sequenced, right most takes precedence.
When binary are sequenced, the right most takes precedence.
When both are mixed, Binary operator has precedence than uninary.
Paren can be used to break the above precedence rule.

That seems to summarize it without ambiguity.
Show full article (1.09Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Author: xahlee
Date: Aug 19, 2008 23:03

On Aug 19, 9:15 pm, Paul Donnelly sbcglobal.net> wrote:
> "xah...@gmail.com" gmail.com> writes:
>> according to
>>http://en.wikipedia.org/wiki/APL_(programming_language)
>
>> quote:
>> «As APL has many nonstandard primitives (functions and operators,
>> indicated by a single symbol or a combination of a few symbols), it
>> does not have function or operator precedence.»
>
>> that cant be true, since function is a broad conception that includes
>> any operators.
>
>> But my question is about the statement that APL doesn't have operator
>> precedence. As far as i know, in linear textual languages (as opposed
>> to spread sheets, visual langs etc), unless it uses nested functional
>> notation (e.g. Mathematica, lisp), i can't see how it can do without
>> operator precedence?
>
>> For example, in Wikipedia this code example for picking 6 random ...
Show full article (2.80Kb)
no comments
Re: Wikipedia article on APL has come of age!         


Date: Aug 19, 2008 23:17

xahlee@gmail.com wrote:
> On Aug 19, 4:26 pm, "xah...@gmail.com" gmail.com> wrote:
>> On Aug 19, 4:08 pm, Bakul Shah bitblocks.com> wrote:
>>
>>> ...
>>> They say it has no precedence rules because you parse from left to
>>> right. A monadic function grabs the result of *everything* to its
>>> right. A dyadic function grabs the result of everything to its right
>>> and the item on its left. Use parentheses when the left operand is
>>> to be computed from an expression. So for example you can do
>>> (2 × 3) + 4 × 5
>>> and get 26. (× is the multiply function).
>
> damn, post too past again.
>
> Ok, summarizing posts in thread, it seems to be this:
>
> in APL, there's uninary and binary operators.
> When uninary operator are sequenced, right most takes precedence.
> When binary are sequenced, the right most takes precedence. ...
Show full article (2.05Kb)
no comments
1 2