Sequences - Xref - Types - sequence


App: regression/framework Page: prefixes/sequence_names_a_sequence_type
PHP
HTML
prefixes/sequence_names_a_sequence_type.pad
Result
{sequence:prime rows=3}
{$sequence},
{/sequence:prime}

App: regression/framework Page: sequence/a_count_of_zero_gives_no_rows
PHP
sequence/a_count_of_zero_gives_no_rows.php
HTML
sequence/a_count_of_zero_gives_no_rows.pad
Result
<?php

$n
= 0;
$m = 3;

?>
[{sequence $n}{$sequence} {/sequence}][{sequence prime, rows=0}{$sequence} {/sequence}][{loop0}x{/loop}][{sequence $m}{$sequence} {/sequence}]

App: regression/framework Page: sequence/a_count_or_range_given_to_a_type_without_a_parameter_is_read_as_such
PHP
HTML
sequence/a_count_or_range_given_to_a_type_without_a_parameter_is_read_as_such.pad
Result
[{prime 5}{$prime} {/prime}][{fibonacci 5}{$fibonacci} {/fibonacci}][{keep:prime '1..10'}{$sequence} {/keep:prime}][{flag:even '1;2;3'}{$sequence}{/flag:even}][{multiply 3, rows=3}{$multiply} {/multiply}][{repeat 'x', rows=2}{$repeat}{/repeat}]

App: regression/framework Page: sequence/a_list_given_to_a_type_named_by_the_tag_is_the_values_it_plays_over
PHP
HTML
sequence/a_list_given_to_a_type_named_by_the_tag_is_the_values_it_plays_over.pad
Result
[{prime [3,5,7]}{$prime} {/prime}][{keep:prime [1,2,3,4,5]}{$sequence} {/keep:prime}][{fibonacci [1,2,3]}{$sequence} {/fibonacci}]

App: regression/framework Page: sequence/a_number_right_after_an_option_naming_a_type_or_an_action_that_counts_is_its_value
PHP
HTML
sequence/a_number_right_after_an_option_naming_a_type_or_an_action_that_counts_is_its_value.pad
Result
{sequence '1..9', push='a'/}[{pull:a first, 2}{$sequence} {/pull:a}][{pull:a add, 2}{$sequence} {/pull:a}][{sequence '1..3', add, 2}{$sequence} {/sequence}][{sequence '1..3', first, 2}{$sequence} {/sequence}][{prime first, 3}{$sequence} {/prime}][{sequence add, 3, rows=3}{$sequence} {/sequence}]

App: regression/framework Page: sequence/a_request_value_put_back_at_a_levels_end_after_a_set_gives_way_to_the_tag_again
PHP
sequence/a_request_value_put_back_at_a_levels_end_after_a_set_gives_way_to_the_tag_again.php
HTML
sequence/a_request_value_put_back_at_a_levels_end_after_a_set_gives_way_to_the_tag_again.pad
Result
<?php

// The visitor sends ?prime=<b>evil</b>. A level variable of the same name puts the
// request's value aside and back at the level's end, and a {set} inside the level changes
// the name for that level only: the value put back is the request's again, so {prime} is
// the sequence type, never the visitor's text written raw in its place.

padGetParms ( 'GET', [ 'prime' => '<b>evil</b>' ] );

?>
[{if 1 eq 1, $prime = 'x'}{set $prime = 'y'}{/if}{prime rows=3}{$prime} {/prime}]
[{sequence '1..1', $prime = 'x'}{set $prime = 'y'}{/sequence}{prime rows=3}{$prime} {/prime}]

App: regression/framework Page: sequence/a_type_named_by_a_parameter_while_the_type_is_settled_plays_on_it
PHP
HTML
sequence/a_type_named_by_a_parameter_while_the_type_is_settled_plays_on_it.pad
Result
[{prime 'even', rows=4}{$sequence} {/prime}|{prime even, rows=4}{$sequence} {/prime}][{sequence 'prime', 'square', rows=3}{$sequence} {/sequence}][{reverse 'prime', 'even', rows=4}{$sequence} {/reverse}][{keep:prime 'even'}{$sequence} {/keep:prime}]

App: regression/framework Page: sequence/a_type_named_by_its_tag_or_with_an_empty_parameter_is_the_bare_type
PHP
HTML
sequence/a_type_named_by_its_tag_or_with_an_empty_parameter_is_the_bare_type.pad
Result
[{add rows=3}{$add} {/add}][{sequence:add rows=3}{$sequence} {/sequence:add}][{set $x = ''}{sequence add=$x, rows=3}{$sequence} {/sequence}][{sequence '1..3', multiply=$x}{$sequence} {/sequence}][{echo sequence:add(3, '')}][{divide rows=3}{$divide} {/divide}][{and rows=3}{$and} {/and}][{keep:multiply from=1, to=3}{$sequence} {/keep:multiply}]

App: regression/framework Page: sequence/a_type_store_or_action_given_as_the_first_parameter_is_run
PHP
HTML
sequence/a_type_store_or_action_given_as_the_first_parameter_is_run.pad
Result
[{sequence 'prime'}{$sequence} {/sequence}][{set $t = 'fibonacci'}{sequence $t, rows=5}{$sequence} {/sequence}]{sequence '1..5', push='s'}{/sequence}[{sequence 's'}{$sequence} {/sequence}][{action 's', reverse}{$sequence} {/action}][{keep 'odd', s}{$sequence} {/keep}][{pull:s 'reverse'}{$sequence} {/pull:s}][{repeat 'prime', rows=2}{$repeat} {/repeat}][{sequence 'sum', from=1, to=4}{$sequence}{/sequence}]

App: regression/framework Page: sequence/a_value_spliced_into_any_eval_expression_is_text
PHP
sequence/a_value_spliced_into_any_eval_expression_is_text.php
HTML
sequence/a_value_spliced_into_any_eval_expression_is_text.pad
Result
<?php

// A value spliced into the quoted expression of the eval sequence is a string of it in every
// spelling - {eval '...'}, {sequence:eval '...'}, make='eval|...', sequence:eval(2, '...') -
// as in eval='...': only eval= quoted it, and in the others the value became part of the
// expression and called the function it named.

$q = 'php:gettype()';

?>
e[{eval '@ . {$q}', rows=2}{$eval} {/eval}] s[{sequence:eval '@ . {$q}', rows=2}{$eval} {/sequence:eval}] m[{sequence '1..2', make='eval|@ . {$q}'}{$sequence} {/sequence}] c[{echo sequence:eval(2, '@ . {$q}')}]

App: regression/framework Page: sequence/an_action_named_by_its_prefix_takes_its_count_from_the_option_of_its_name
PHP
HTML
sequence/an_action_named_by_its_prefix_takes_its_count_from_the_option_of_its_name.pad
Result
{sequence '1..6', push='a'/}[{a:shift shift=3}{$sequence} {/a:shift}|{pull:a}{$sequence} {/pull:a}]{sequence '1..6', push='a'/}[{action:first a, first=3}{$sequence} {/action:first}][{action:minimum a, minimum=3}{$sequence} {/action:minimum}][{sequence:last a, last=3}{$sequence} {/sequence:last}][{action:shift a, 2}{$sequence} {/action:shift}|{pull:a}{$sequence} {/pull:a}]{sequence '1..6', push='a'/}[{a:first reverse, first=2}{$sequence} {/a:first}]

App: regression/framework Page: sequence/the_pager_of_a_sequence_has_the_page_size_the_sequence_used
PHP
HTML
sequence/the_pager_of_a_sequence_has_the_page_size_the_sequence_used.pad
Result
[{prime 5, page=2}{$prime} {/prime}{pager 'prime'}{$kind}:{$page} {/pager}][{sequence 4, page=3}{$sequence} {/sequence}{pager 'sequence'}{$kind}:{$page} {/pager}]{set $n = 10 ** 30}[{sequence '1..5', page=1, rows=$n}{$sequence} {/sequence}][{sequence '1..5', page=$n, rows=2}{$sequence} {/sequence}{pager 'sequence'}{$kind}:{$page} {/pager}]

App: regression/framework Page: sequence/the_type_field_follows_the_rows_through_an_action
PHP
HTML
sequence/the_type_field_follows_the_rows_through_an_action.pad
Result
{sequence '1..5', push='nums'}
a[{fibonacci rows=6, reverse}{$fibonacci}/{$sequence} {/fibonacci}]
b[{fibonacci rows=6, last=2}{$fibonacci}/{$sequence} {/fibonacci}]
c[{fibonacci rows=6, sum}{$fibonacci}/{$sequence} {/fibonacci}]
d[{fibonacci rows=5, make, multiply=2, reverse}{$fibonacci}/{$multiply}/{$sequence} {/fibonacci}]
e[{fibonacci rows=6, name='f', reverse}{$fibonacci}/{$f} {/fibonacci}]
f[{nums reverse}{$nums} {/nums}]
g[{pull:nums reverse}{$nums}/{$sequence} {/pull:nums}]
h[{nums sum}{$nums}{/nums}]

App: regression/pages Page: request/tagnames
PHP
request/tagnames.php
HTML
request/tagnames.pad
Result
<?php

// Fixture for a_request_value_never_decides_what_a_tag_is: a constant, pipe functions, two
// sequences, a _data file, an application pipe function and PHP functions written as tags
// and pipes - and $ucwords, a variable the page sets itself, which stays the field it is, as
// $date does, given a default that keeps the request's value when one came. Fetched bare it
// answers what the template means by each name.

$ucwords = 'mine';
$who = $who ?? 'nobody';
$date = $date ?? '2000-01-01';

// A name in a comment, a string or a function's parameter is none of the page's: $upper
// here, '$fibonacci' and $nums below stay the template's, and so does the closure's local
// $exclaim behind a binary string.

$tagNamesText = 'the $fibonacci sequence';
$tagNamesBinary = b"a binary string for $who";
$tagNamesLocal = function ( $nums ) { $exclaim = 1; return $nums; };

?>
[{PHP_INT_SIZE}][{upper}abc{/upper}][{fibonacci rows=3}{$fibonacci}{/fibonacci}][{prime rows=3}{$prime}{/prime}][{nums}{$nums}{/nums}][{exclaim}hi{/exclaim}][{echo 'abc' | strrev}][{strtoupper 'x'}][{ucwords}][{who}][{date}]

App: sequence Page: check/add