1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax ;
7 { $description "Outputs several slot values to the stack." }
8 { $example "USING: kernel prettyprint slots.syntax ;"
9 "IN: slots.syntax.example"
10 "TUPLE: rectangle width height ;"
11 "T{ rectangle { width 3 } { height 5 } } slots[ width height ] [ . ] bi@"
17 { $description "Outputs an array of slot values from a tuple." }
18 { $example "USING: prettyprint slots.syntax ;"
19 "IN: slots.syntax.example"
20 "TUPLE: rectangle width height ;"
21 "T{ rectangle { width 3 } { height 5 } } slots{ width height } ."
25 ARTICLE: "slots.syntax" "Slots syntax sugar"
26 "The " { $vocab-link "slots.syntax" } " vocabulary provides an alternative syntax for taking a sequence of slots from a tuple." $nl
27 "Syntax sugar for cleaving slots to the stack:"
28 { $subsections POSTPONE: slots[ }
29 "Syntax sugar for cleaving slots to an array:"
30 { $subsections POSTPONE: slots{ } ;