Skip to content

Commit

Permalink
[S06] supply missing list splitting primitive as a form of binding, m…
Browse files Browse the repository at this point in the history
  • Loading branch information
lwall committed Sep 11, 2009
1 parent bf50574 commit cc595c7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions S06-routines.pod
Expand Up @@ -15,8 +15,8 @@ Synopsis 6: Subroutines

Created: 21 Mar 2003

Last Modified: 7 Sep 2009
Version: 114
Last Modified: 11 Sep 2009
Version: 115


This document summarizes Apocalypse 6, which covers subroutines and the
Expand Down Expand Up @@ -833,11 +833,20 @@ elements of the variadic array:

Slurpy scalars still impose list context on their arguments.

Slurpy parameters are treated lazily -- the list is only flattened
Single slurpy parameters are treated lazily -- the list is only flattened
into an array when individual elements are actually accessed:

@fromtwo = tail(1..Inf); # @fromtwo contains a lazy [2..Inf]

[Conjecture: However, if you use two or more slurpy arrays in a
signature, the list is instead evaluated in hyper context, and will
be asked to split itself into the number of lists corresponding to
the number of slurpies so declared. A non-hyperable list will return
failure for this splitting operation, so the signature should only bind
on parallelizable list operations. Likewise a list that "too short to
split" fails to bind, so a separate signature may match empty lists,
and perhaps singletons, if we define "too short" that way).]

You can't bind to the name of a slurpy parameter: the name is just there
so you can refer to it within the body.

Expand Down

0 comments on commit cc595c7

Please sign in to comment.