- '''
- Given a dict and a iterable of (name, [alias, ...]) pairs, create
- additional entries in the dict mapping each alias to the named function
- if it's in the dict. Aliases for functions not in the dict are ignored.
- '''
- for name, aliases in A:
- try:
- F = D[name]
- except KeyError:
- continue
- for alias in aliases:
- D[alias] = F
-
-
-definitions = ('''\
-? dup truthy
-*fraction [uncons] dip uncons [swap] dip concat [*] infra [*] dip cons
-*fraction0 concat [[swap] dip * [*] dip] infra
-anamorphism [pop []] swap [dip swons] genrec
-average [sum 1.0 *] [size] cleave /
-binary nullary [popop] dip
-cleave fork [popd] dip
-codireco cons dip rest cons
-dinfrirst dip infra first
-unstack ? [uncons ?] loop pop
-down_to_zero [0 >] [dup --] while
-dupdipd dup dipd
-enstacken stack [clear] dip
-flatten [] swap [concat] step
-fork [i] app2
-gcd 1 [tuck modulus dup 0 >] loop pop
-ifte [nullary not] dipd branch
-ii [dip] dupdip i
-least_fraction dup [gcd] infra [div] concat map
-make_generator [codireco] ccons
-nullary [stack] dinfrirst
-of swap at
-pam [i] map
-tailrec [i] genrec
-product 1 swap [*] step
-quoted [unit] dip
-range [0 <=] [1 - dup] anamorphism
-range_to_zero unit [down_to_zero] infra
-run [] swap infra
-size 0 swap [pop ++] step
-sqr dup mul
-step_zero 0 roll> step
-swoncat swap concat
-tailrec [i] genrec
-ternary unary [popop] dip
-unary nullary popd
-unquoted [i] dip
-while swap [nullary] cons dup dipd concat loop
-'''
-#
-#
-# ifte == [nullary] dipd swap branch
-# genrec == [[genrec] cons cons cons cons] nullary swons concat ifte
-
-# Another definition for while. FWIW
-# while == over [[i] dip nullary] ccons [nullary] dip loop
-
-##ccons == cons cons
-##unit == [] cons
-##second == rest first
-##third == rest rest first
-##swons == swap cons
-
-##Zipper
-##z-down == [] swap uncons swap
-##z-up == swons swap shunt
-##z-right == [swons] cons dip uncons swap
-##z-left == swons [uncons swap] dip swap
-
-##Quadratic Formula
-##divisor == popop 2 *
-##minusb == pop neg
-##radical == swap dup * rollup * 4 * - sqrt
-##root1 == + swap /
-##root2 == - swap /
-##q0 == [[divisor] [minusb] [radical]] pam
-##q1 == [[root1] [root2]] pam
-##quadratic == [q0] ternary i [q1] ternary
-
-# Project Euler
-##'''\
-##PE1.1 == + dup [+] dip
-##PE1.2 == dup [3 & PE1.1] dip 2 >>
-##PE1.3 == 14811 swap [PE1.2] times pop
-##PE1 == 0 0 66 [7 PE1.3] times 4 PE1.3 pop
-##'''
-#PE1.2 == [PE1.1] step
-#PE1 == 0 0 66 [[3 2 1 3 1 2 3] PE1.2] times [3 2 1 3] PE1.2 pop
-)