Here is a peculiar case,
⎕PP
17
{⍕'PI',○2}
PI 6.2831853071795862
{⍕'PI' '2PI',[1.5]○1 2}
PI 3.141592654
2PI 6.283185307
'PI' '2PI',[1.5]○1 2
PI 3.1415926535897931
2PI 6.2831853071795862
Here is a peculiar case,
⎕PP
17
{⍕'PI',○2}
PI 6.2831853071795862
{⍕'PI' '2PI',[1.5]○1 2}
PI 3.141592654
2PI 6.283185307
'PI' '2PI',[1.5]○1 2
PI 3.1415926535897931
2PI 6.2831853071795862
Hi Elias,
If I understood your solution correctly, it basically boils down to the
(correct, as far as I can tell)
assumption that, for every block of adjacent face-down pancakes, you need two
flips:
- one to flip all the pancakes up to the first face-down one
- one to flip the whole block of now
> On Jun 23, 2016, at 7:07 AM, Louis Chretien wrote:
>
> R←{X} (A ⎕R B) Y
The line on the title? It’s not really the language syntax. It’s their way to
tell you that ⎕R is an operator that receives required left and right operands
A and B, and creates a ambivalent function that applies on r
As strange as it may seem, the parenthesed expression returns an operator,
which is then applied to the function on the left.
GNU APL does not support first-class functions (and operators) so this
syntax is not an option for us.
Regards,
Elias
On 23 Jun 2016 8:08 pm, "Louis Chretien" wrote:
> S
Since Dyalog has created those ⎕R and ⎕S, it might be a good starting point.
But i am always baffled by the syntax of using parenthesis to group on the
function on the left and have it applied to the right argument, like Dialog
shows on their webpage:
R←{X} (A ⎕R B) Y
> On Jun 22, 2016, at 14