Home

Alter Programmer`s Reference Manual

image

Contents

1. write postamble document context gt nil Writes a postamble on the receiver s stream write preamble document context gt nil Writes a preamble on the receiver s stream F Alter Reference Manual 49 Document Generation 50 NANI SEY SA Enumerating assoc obj list pair or f This procedure finds the first pair in list whose car field is obj and returns that pair If no pair in list has obj as its car then f not the empty list is returned Assoc uses equal to compare argl with the car fields of the pairs in list See also assq assv assoc list a a b c gt a assq obj list pair or f This procedure finds the first pair in list whose car field is obj and returns that pair If no pair in list has obj as its car then f not the empty list is returned Assq uses eq to compare argl with the car fields of the pairs in list See also assv assoc assq list a 2 b c gt f assq 5 23 5 7 11 13 gt unspecified define e a 1 b 2 c 3 assq a e gt a 1 assq b e gt b 2 assq d e gt f assv obj list pair or f This procedure finds the first pair in list whose car field is obj and returns that pair If no pair in list has obj as its car then f not the empty list is returned Assv uses eqv to compare argl with the car fields of the pairs in list See also assq assoc assv 5 23 5 7 11 13
2. set line width document context width gt nil Sets the line width of the context to the integer argument The value indicates how many pixels wide the pen is for drawing lines set page height document context inches gt nil Sets the width a page generated by the receiver The size is in inches F Alter Reference Manual 47 Document Generation set page width document context inches gt nil Sets the size of the width of a page generated by the receiver The size is in inches set paint color document context color value gt nil Given a graphics context instance sets the context s cur rent paint color to the color value argument The argu ment is a colorvalue instance representing the current pen color for drawing objects See make rgb color make hsb color and make cmy color for making a colorvalue instance set paint style document context symbol gt nil Given a graphicscontext instance sets the context s cur rent paint style to the symbol argument The argument is a symbol representing the current pen drawing style solid or gray See also set paint color set porti document context port gt nil Sets the receiver s current output port to the argument set print size document context inches gt nil Sets the maximum dimension in inches of printed data when drawing graphics set relative scale document context factor gt nil Sets a value like 1 0 or 1 5 150 etc that
3. supertypes type list Returns a list containing the argument s immediate super types F Alter Reference Manual 131 Types 132 User Requests confirm message initialanswer yesstring nostring gt t or f Pops up a dialog window with two buttons The window is labeled with the given string The second and remain ing arguments are optional If the second argument is given it must be a boolean indicating which button is to be the default the one considered pressed if the user hits the Return key on the keyboard The third argu ment if present is a string that is used as the label for the true valued button The fourth argument if present is a string that is used as the label for the false valued button Confirm returns a boolean value corresponding to the button that was chosen by the user request directory name filename filename Pops up a dialog window prompting the user to desig nate an existing directory to use in a subsequent activity Returns a filename unless the user cancels the operation in which case it returns nil request file name filename filename Pops up a dialog window prompting the user to desig nate an existing file to use in a subsequent activity Returns a filename unless the user cancels the operation in which case it returns nil request new file name filename filename Pops up a dialog window prompting the user to desig nate a new
4. 2 5 point 5 2 3 4 gt 2 5 point max point rest point Returns the lower right corner of the rectangle that con tains all of the points passed as arguments point min 2 2 1 3 gt 2 3 point min 3 2 3 1 2 4 gt 3 4 point min point rest gt point Returns the upper left corner of the rectangle that con tains all of the points passed as arguments point min 2 2 1 3 gt 1 2 point min 3 2 3 1 2 4 gt 2 1 F Alter Reference Manual 101 Points point point1 point2 point This procedure returns the quotient of its argument points See point for an explanation of how points are represented in Alter point 6 2 3 2 gt 2 1 point 6 2 3 2 gt 2 1 point 16 32 4 gt 4 8 point 40 40 4 1 2 gt 10 5 point lt pt1 pt2 pt3 gt t or f Returns t if both the x and y coordinates of the first point are less than the x and y coordinates of the second point see point Otherwise returns f point lt 3 2 4 5 gt t point lt 3 2 2 2 gt f point lt pt1 pt2 pt3 gt t or f Returns t if both the x and y coordinates of the first point are less than or equal to the x and y coordinates of the sec ond point see point Otherwise returns f point lt 3 2 4 2 gt t point lt 3 2 3 1 gt f point gt pt1 pt2 pt3 gt
5. Alter Programmer s Reference Manual Legal Notices Trademarks Copyright O 1992 1999 by Honeywell Inc This is version 5 2 of the DoME Alter Programmer s Reference Manual Email dome info htc honeywell com Web www htc honeywell com dome The information contained in this document is subject to change without notice Neither Honeywell nor the developers of DoME make any warranty of any kind with regard to this guide orits associated products including but not limited to the implied warranties of merchantability and fitness for a particular purpose Neither shall Honeywell nor the developers be liable for errors contained herein or direct indirect special incidental or consequential damages in connection with the performance or use of this guide or its associated products Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one Interleaf is a registered trademark of Interleaf Inc Macintosh is a registered trademark of Apple Computer Inc Microsoft Windows 95 and Windows NT are trademarks of Microsoft Corp Microsoft and Windows are registered trademarks of Microsoft
6. DoMENode NetArc See also add method find operation Alter s implementation of classes operations and methods follows the OakLisp style as presented in the OOPSLA 86 Proceedings methods operation list Returns an alist see assoc containing the types and pro cedures currently defining the operation Each alist com ponent is of the form class procedure predefined bindings list 38 Returns a list of pairs that represent the predefined bind ings Each pair has a car that is a symbol and a cdr that is the value bound to that symbol User defined procedures and operations are NOT included in this list see bind ings Defining quasiquote expression gt object Backquote or quasiquote expressions are useful for constructing a list or vector structure when most but not all of the desired structure is known in advance If no commas appear within the lt template gt the result of eval uating lt template gt is equivalent to the result of evaluat ing template If a comma appears within the template however the expression following the comma is evaluated unquoted and its result is inserted into the structure instead of the comma and the expres sion If a comma appears followed immediately by an at sign 0 then the following expression must evaluate to a list the opening and closing parentheses of the list are then stripped away and the elements of the elements of the l
7. gt abc d append Y a gt a copy without ist object gt newlist Returns a copy of the list with all top level references to object removed using eq test copy without a b c b a c ab cb b gt ac b b gt ab c b gt a c b c b gt nil c copy without nil nil nil c nil gt nil c copy without a b c b gt a b c copy without a b c b a b c copy without copy without copy without copy without flatten list gt list Returns a list whose members are those elements that are either atoms or members of the result of applying flatten to an element that is a list F Alter Reference Manual 15 Collections length string gt integer length list gt integer length vector integer Length is an operation in Alter defined on strings vec tors and lists This is an extension to Scheme R4 which specifies length as a procedure defined only on lists For strings length behaves exactly like string length For vectors length behaves exactly like vector length length abcde 5 length 1 2 3 3 For lists length returns the number of topmost cells in the argument list as the following examples illustrate length a b c gt 3 length a b c d e gt 3 length gt 0 substitute string substring replacement gt string tim string gt string Return a copy of the
8. gt f type operation t type make type object type t vector object gt t or f Returns t if sexpr is a vector otherwise returns f writable filename type gt t or f Returns t if the filename represents a file than can be opened for writing Otherwise returns f The file must exist or Alter will raise an error 122 AAZ NN Testing Characters 1881 LY char alphabetic char t or f This procedure returns t if its argument is alphabetic otherwise it returns f The alphabetic characters are the 52 upper and lower case letters See also char numeric char whitespace char upper case and char lower case char ci lt arg arg2 t or f This procedure is similar to char lt but treats upper case and lower case letters as the same For example char ci lt a B returns t whereas char lt Ha HB returns f char ci lt arg arg2 t or f This procedure is similar to char lt but treats upper case and lower case letters as the same For example char ci lt Ha B returns t whereas char lt Ha B returns f char ci arg arg2 t or f This procedure is similar to char but treats upper case and lower case letters as the same For example char ci A a returns t char ci gt arg arg2 gt t or f This procedure is similar to char gt but treats upper case and lower case letters as the same
9. nil Sets the value of the font s italic property to the boolean argument set serifi font description boolean nil Sets the value of the font s serif property to the boolean argument set stikeout font description boolean nil Sets the value of the font s strikeout property to the bool ean argument F Alter Reference Manual 55 Font Descriptions set undenline font description boolean nil Sets the value of the font s underline property to the bool ean argument size font description points Returns the size of the font in pixels strikeoutfont description gt boolean Returns a boolean indicating whether the font is repre sented with a strikeout underline font description boolean Returns a boolean indicating whether the font is repre sented with an underline 56 Graphics draw art context bounding rectangle start angle sweep angle fill gt nil draw art document context bounding rectangle start angle sweep angle I fill l gt nil Draws an arc on the given graphics context If the fill flag is true the arc will be filled in a pie wedge fashion The arc is drawn to inscribe the specified rectangle The start and sweep angles are in degrees Zero degrees is right ward along the x axis and the sweep angle proceeds clockwise draw line context from point to point gt nil draw line document context from point to point nil Draws a line on the given gr
10. spondence between exact and inexact integers through out an implementation dependent range integer gt char int character Given an exact integer that is the image of a character under char gt integer integer gt char returns that charac ter This procedure implements an injective order iso morphism between the set of characters under the char lt ordering and some subset of the integers under the lt ordering Thatis if char lt ab gt t and lt x y gt t and x and y are in the domain of integer gt char then char integer gt char x integer gt char y gt t list gt string listofchars gt string List gt string returns a newly allocated string formed from the characters in the list of args String gt list and list gt string are inverses so far as equal is concerned list gt vector list vector List gt vector returns a newly created vector initialized to the elements of the list arg See also vector gt list list gt vector dididit dah gt dididit dah number gt string number radix string Radix must be an exact integer either 2 8 10 or 16 If omitted radix defaults to 10 The procedure number gt string takes a number and a radix and returns as a string an external representation of the given number in the given radix such that let number n radix r eqv n string gt number number gt string n r r is true It is an error if no possible
11. F Alter Reference Manual 69 Logic 70 Math Functions AN AZ AAZ DIN acos number gt number asin number gt number atan y x gt number cos number gt number exp number number V S V SL This procedure computes the usual transcendental func tion This procedure computes the usual transcendental func tion This procedure computes the usual transcendental func tion This procedure computes the usual transcendental func tion Exp computes efnumber The result is a real number expt base exponent number log number number sin number gt number tan number gt number Returns base raised to the power exponent num ber exponent eNexponent log base 040 is defined to be equal to 1 Log computes the natural logarithm of arg not the base ten logarithm This procedure computes the usual transcendental func tion This procedure computes the usual transcendental func tion F Alter Reference Manual 71 Math Functions 72 Miscellaneous category thunk category string Given a procedure or operation returns its category as a string This category is where the procedure or operation can be found in the various browsers that are part of the Projector Alter programming environment If a second optional argument is given it must be a string and it is used to set the category of the procedure or operation date tod
12. border bounds 76 bottom margin 45 bound 115 bounds 76 brightness 17 bring to focus 93 C call cc 21 call with current continuation 19 car 65 category 73 cdr 65 ceiling 10 center 107 char 124 124 char 124 char gt 124 char gt 124 char gt integer 27 char 115 char alphabetic 123 char ci 123 123 char ci 123 char ci gt 123 char ci gt 123 char downcase 27 char lower case 123 char numeric 123 char ready 59 char upcase 27 char upper case 124 char whitespace 124 class 115 clear selection 93 close 59 close input port 59 close model 93 close output port 59 color 76 Index 137 Index color 115 commit 59 components 76 cond 23 configurations 76 confirm 133 cons 65 construct 53 container 76 contents 59 copy 33 copy to 53 copy without 15 cos 71 cr 45 current binding 76 current configuration 76 current directory 53 current input port 59 current output port 59 current package 99 cyan 17 D data dictionary edit 93 dates 53 date today 73 dec indent level 45 default child type 77 default font description 55 define 34 delete 53 delete package 99 deletion request 93 denominator 10 description 77 deselect all 93 destination 77 detect 51 dictionary gt list 41 dictionary 115 dictionary keys 41 dictionary ref 41 dictionary set 41 dictionary unset 42 dictionary values 42 direction 77 directory 115 display 59 Index 138 display errors 93 do 2
13. either exact or inexact is true but not both inexact object t or f Exact provides a test for the exactness of a quantity For any Alter number either exact or inexact is true but not both integer object t or f Integer can be applied to any kind of argument includ ing non numbers It returns t if the object is an integer and otherwise it returns f If integer is true of a number then all higher type predi cates are also true of that number Consequently if inte ger is false of a number then all lower type predicates are also false of that number If x is an inexact real number then integer x is true if and only if x round x integer 3 0 gt t integer 8 4 gt t The behavior of integer on inexact numbers is unreliable since any inaccuracy may affect the result See also number complex real and rational negative object gt t or f This procedure returns t if its argument is less than zero The result for inexact numbers may be unreliable because of small inaccuracies F Alter Reference Manual 127 Testing Numbers odd object gt t or f This procedure returns t if its argument is odd exactly halfway between two adjacent multiples of 2 The result for inexact numbers may be unreliable because of small inaccuracies positive object gt t or f This procedure returns t if its argument is greater than zero The result for inexact n
14. nl n2 numeric range return value only argtype zero or more arguments of type argtype F Alter Reference Manual Notation Conventions NANI VANN SV Arithmetic numbers gt number This procedure return the product of its arguments This procedure is exactness preserving 217 5 gt 35 0 4 gt 4 e numbers number This procedure returns the sum of its arguments This procedure is exactness preserving 3 4 gt 7 3 4 0 gt 7 0 3 gt 3 gt 0 number rest number With two or more arguments this procedure returns the difference of its arguments associating to the left With one argument however it returns the additive inverse of its argument This procedure is exactness preserving 3 4 gt 1 34 5 gt 6 3 gt 3 number rest gt number With two or more arguments this procedure returns the quotient of its arguments associating to the left With one argument however it returns the multiplicative inverse of its argument This procedure is exactness preserving except that divi sion may coerce its result to inexact in implementations that do not support ratnums 345 3 20 3 gt 1 3 1 5 3 gt 0 5 lt num1 num2 num3 gt t or f This procedures returns t if its arguments are monotoni cally increasing lt is transitive The traditional implementations of
15. t if sexpr is a character otherwise returns f class object gt t or f Returns true if the given object represents a grapething class or one of its subclasses returns false otherwise class 5 gt f class integer type gt t class grapething gt t class node gt f class make type Y 0 gt f color object gt t or f Returns true if the given object is an instance of color type returns false otherwise See palette colors dictionary object gt t or f Returns true if the given object is a dictionary instance see make dictionary returns false otherwise directory filename type gt t or f Returns t if the filename represents a directory on the host system Returns f otherwise eq arg arg2 t or f Eq is similar to eqv except that in some cases it is capa ble of discerning distinctions finer than those detectable by eqv Eq and eqv are guaranteed to have the same behavior on symbols booleans the empty list pairs and non empty strings and vectors Eq s behavior on numbers and characters is implementation dependent but it will always return either true or false and will return true F Alter Reference Manual 115 Testing only when eqv would also return true Eq may also behave differently from eqv on empty vectors and empty strings eq a a gt t eq a a gt unspecified eq list a list a gt f eq a a
16. uninterned symbol argl and arg2 are both numbers are numerically equal see and are either both exact or both inexact argl and arg2 are both characters and are the same char acter according to the char procedure both argl and arg2 are the empty list argl and arg2 are pairs vectors or strings that denote the same locations in the store argl and arg2 are procedures whose location tags are equal The eqv procedure returns f if argl and arg2 are of different types one of arg1 and arg2 is t but the other is f argl and arg2 are symbols but string symbol gt string arg1 symbol gt string arg2 gt f one of argl and arg2 is an exact number but the other is an inexact number argl and arg2 are numbers for which the procedure returns f argl and arg2 are characters for which the char proce dure returns f one of argl and arg2 is the empty list but the other is not argl and arg2 are pairs vectors or strings that denote distinct locations argl and arg2 are procedures that would behave differ ently return a different value or have different side effects for some arguments F Alter Reference Manual 117 Testing 118 equ a a gt t equ ab eqv 2 2 gt t ev 00 gt it eqv 100000000 100000000 gt t eqv cons 1 2 cons 1 2 gt f eqv lambda 1 lambda 2 gt f eqv f nil gt f let p lambda x x eqv p p gt t
17. 7 2 gt 4 round 7 gt 7 Returns the principal square root of number The result will have either positive real part or zero real part and non negative imaginary part truncate number integer Truncate returns the integer closest to number whose absolute value is not larger than the absolute value of number The result is always exact truncate 4 3 gt 4 truncate 3 5 gt 3 F Alter Reference Manual 13 Arithmetic 14 Collections append string string2 gt string append list1 list2 gt list Append is an operation defined on both strings and lists This is an extension to Scheme R4 which defines append as a procedure defined only on lists Given list arguments append returns a list consisting of the elements of the first argument list followed by the ele ments of the remaining argument lists Given string arguments append returns a string consist ing of the elements of the first string followed by the ele ments of the remaining string arguments append x y gt x y append a b c d gt a b c d append a b c gt a b c append a bcd abcd The resulting list or string is always newly allocated except that in the case of lists the result shares structure with the last list argument With lists the last argument may actually be any object an improper list results if the last argument is not a proper list append a b c d
18. 9 4 gt 3 9 inexact If any argument is inexact then the result will also be inexact If min is used to compare numbers of mixed exactness and the numerical value of the result cannot be represented as an inexact number without loss of accu racy then the procedure may report a violation of an implementation restriction modulo numerator divisor integer This exactness preserving procedure implement number theoretic integer division For positive integers n1 and n2 if n3 and n4 are integers such that n1 n2 n3 n4 and 0 lt n4 lt n2 then modulo n1 n2 gt n4 provided all numbers involved in that computation are exact Remainder and modulo differ on negative arguments F Alter Reference Manual 11 Arithmetic the remainder is either zero or has the sign of the divi dend while the modulo always has the sign of the divi sor modulo 13 4 gt 1 remainder 13 4 gt 1 modulo 13 4 gt 3 modulo 13 4 gt 3 modulo 13 4 gt 1 numerator fraction gt integer This procedure returns the numerator of its argument the result is computed as if the argument was represented as a fraction in lowest terms The denominator is always positive numerator 6 4 gt 3 quotient numerator divisor integer This exactness preserving procedure implements num ber theoretic integer division For positive integers n1 and n2 if n3 and n4 are integers such that n1 n2 n3 n4 and 0 lt n
19. Corp VisualWorks ia a registered trademarks of ObjectShare Inc FrameMaker PostScript and Adobe are registered trademarks of Adobe Systems Inc Adobe also owns copyrights related to the PostScript language and PostScript interpreter The trademark PostScript is used herein only to refer to material supplied by Adobe or to Adobe defined programs written in the PostScript language Solaris is a trademark of Sun Microsystems Inc UNIX is a registered trademark of UNIX System Laboratories Inc X Window System and X11 are trademarks of X Consortium Inc Other products or services mentioned herein are identified by trademarks designated by the companies that market those products or services Make inquiries concerning such trademarks directly to those companies Contents 4 Notation CoOnVentiONS mmccnoconnancnonnnananennannanonennanaos 7 5 A YANE WO iii AAA 9 6 CONS CUONS ii nan kin ekate ka n An kk LAN AA AA NAN AR AA ARA KARA 15 7 GOJONE REA 17 8 CONGO AAA otan naaien 19 9 Converng sasisissccsssictscscsnsionsucaatsascsnnisisncsacsannsnstens 27 10 Defining era 33 11 Dictona eS inci nnmnnn 41 12 Document GeneratiON eraarrrrrssaasassnnannannnnnnan 45 13 Enumerating ssssssensnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn 51 A nnmnnn nnana 53 15 Font DescriptiONS ssssssssssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 55 16 Gre DING Sak kk kako aaia nasasasada anana 57 e P 59 g nna nn kaki AA 65 19 LOGIC ri rankin kan at
20. For example char ci gt a B returns t whereas char gt a B returns f char ci gt arg arg2 t or 8 ATS This procedure is similar to char gt but treats upper case and lower case letters as the same For example char ci NA b returns t whereas char gt HA Nb returns f char lower case char gt t or f The procedures return t if its argument is a lower case character otherwise it returns f The alphabetic charac ters are the 52 upper and lower case letters See also char whitespace char numeric char whitespace and char upper case char numeric char t or f This procedure returns t if its argument is numeric oth erwise it returns f The numeric characters are the ten decimal digits See also char alphabetic char whitespace char upper case and char lower case F Alter Reference Manual 123 Testing Characters char upper case char gt t or f This procedure returns t if its argument is upper case otherwise it returns f The alphabetic characters are the 52 upper and lower case letters See also char whitespace char numeric char whitespace and char lower case char whitespace char gt t or f This procedure returns t if its argument is whitespace otherwise it returns f The whitespace characters are space tab line feed form feed and carriage return See also char alphabetic char numeric char upper case and cha
21. c b b gt a c remove from list b b gt remove from list ab c b gt a c 1 remove from list remove from list b c b gt nil c nil nil nil c nil gt nil c remove from list Ca p c b gt Cas b te remove from list a b c b gt a b c 66 Lists reverse list list Returns a newly allocated list consisting of the elements of list in reverse order reverse a b c gt c b a reverse a b c d e f gt e f d b c a set car list obj gt object Stores arg in the car field of the pair The value returned by set car is unspecified define f list not a constant list define g constant list set car f3 gt unspecified set car g 3 gt error set cdr list obj object Stores arg in the cdr field of pair The value returned by set cdr is unspecified sort list proc list Return a new list that contains the same elements but ordered by the comparison procedure The comparison procedure should accept two parameters and return t if the first parameter should be ordered before the second f otherwise sort 12 56 2 100 8 lambda a b lt a b gt 2812 56 100 sort foo 56 bar 100 zip 8 lambda a b lt cdr a cdr b gt zip 8 foo 56 bar 100 sort foo 56 bar 100 zip 8 lambda a b string lt c
22. can scale fonts or other values set right margin document context inches gt nil Sets the size of the right margin for a page generated by the receiver The size is in inches set scale document context point gt nil Sets the point used by the receiver to scale points when drawing graphic objects set top margin document context inches gt nil Sets the size of the top margin for a page generated by the document context The size is in inches set translation document context point nil Sets the point used by the receiver to translate points when drawing graphic objects start para ps context style nil start para document context style nil Starts a new paragraph If the optional style parameter is passed a new paragraph with that style is created other wise the receiver s current style is used 48 Document Generation supports native paragraph numbering document context gt boolean Answers t if the given document context represents a format that has native support for multi level paragraph numbering e g Maker Interchange Format Otherwise returns f See also next multilevel tag and reset multi level counter top margin document context gt inches Returns the size of the top margin in inches for a page generated by the document context translation document context point Returns the point used by the receiver to translate points when drawing graphic objects
23. configuration 82 set description 82 set destination 82 set direction 82 set face 47 set family 55 set fixed width 55 set frozen color 82 set indent level 47 set indent size 47 set italic 55 set left margin 47 set line style 47 set line width 47 set master 82 set name 82 set origin 82 set page height 47 set page width 48 set paint color 48 set paint style 48 set parent connection 82 set port 48 set position 83 set print size 48 set property 83 set property schema files 83 set rationale 83 set relative position 83 set relative scale 48 set right margin 48 set route 83 set scale 48 set selection 94 Index 141 Index set serif 55 set size 83 set strikeout 55 set top margin 48 set translation 48 set underline 56 shell 97 show progress begin 26 show progress for each 26 sin 71 size 56 sleep 74 sort 67 sqrt 13 square route 94 start para 48 strikeout 56 string 113 130 130 string 130 string 130 string 130 string gt filename 29 string gt list 29 string gt number 29 string gt symbol 30 string 121 string append 113 string capitalize 30 string ci 129 129 string ci 129 string ci gt 129 string ci gt 129 string copy 113 string downcase 30 string empty 130 string fill 113 string length 113 string ref 113 string set 113 string upcase 30 subdiagrams 83 substitute 16 substring 113 substring index 114 subtype 121 subtypes 131 supertypes 131 s
24. definition should have one of the following forms define variable expression define variable formals body Formals should be either a sequence of zero or more vari ables or a sequence of one or more variables followed by a space delimited period and another variable as in a lambda expression This form is equivalent to define variable lambda formals body define variable formal body Formal should be a single variable This form is equiva lent to define variable lambda formal body At the top level of a program a definition define variable expression has essentially the same effect as the assignment expres sion set variable expression if variable is bound If variable is not bound however then the definition will bind variable to a new location before performing the assignment whereas it would be an error to perform a set on an unbound unbound vari able define add3 lambda x x 3 Defining gt 6 define add2 x x 2 add3 3 gt 5 define sum args apply args sum 12345 gt 15 define first car first 12 gt 1 find operation name gt operation Find operation is a special form The argument is a sym bol that is intended to be bound to an operation Alter first checks the current lexical environment for a binding If one exists and the value is an operation Alter returns that value If one exists and it is not an operation
25. error if set relative position is applied to them In particular subclasses of GraphObjectAttribute typically resist attempts to manually adjust their relative positions See also set position and synchronize display set route netarc list gt unspecified Set the route of the netarc The route is a list of points set size domenode point point set size font description number nil Sets the size of the font in pixels subdiagrams graphobject list Returns a list of graphmodel instances that are children of the given graphobject instance The returned list may be F Alter Reference Manual 83 Model Accessing empty See also parent connection text line heightgraphobject gt integer Return the space between lines top model grapething grapething Answer the graphmodel that is the root of all other graphmodels in the model unset property grapething propname value gt nil unset property propname grapething value nil Removes any value bound to the specified property for the given object If the optional third argument is sup plied the value is unbound only if the current binding is eq to the third argument It is an error if the property name is not valid for the given class of object The DoME Tool Specifications define the properties on the various DoME objects The property name which IS case sensi tive can either by a string or a symbol views grapething list Returns a list
26. file is opened and the port is set to the resulting output port If it is a filename the file is opened and the port is set to the resulting output port If it is an output port the port is set to it An error results if any other type of argument is passed page heightdocument context gt inches Returns the size of the height of a page generated by the receiver in inches page width document context gt inches Returns the size of the width of a page generated by the receiver in inches portdocument context port Returns the receiver s current output port print size document context gt number Returns the maximum dimension in inches of printed data when drawing graphics put string ps context string font description gt nil Add the string to the context s current paragraph using font if specified reset multilevel counter document context key gt nil Resets the multilevel counter If key is given the multi level counter associated with that key is reset default key is para right margin document context inches Returns the size of the right margin in inches for a page 46 Document Generation generated by the receiver scale document context point Returns a point representing the scale factor for all points used when drawing graphics scale to document context rectangle nil Sets the scale and translation using the rectangle argu ment The scale is set to a point whose x and
27. file to use in a subsequent activity Returns a filename unless the user cancels the operation in which case it returns nil user choose message labels values default equalize symbol Pops up a dialog window prompting the user to choose one element from a list or to cancel the decision The first argument is the string to serve as the message to prompt the user The second argument is a list of strings used to label the various buttons that will be created The third argument is a list of symbols one for each button One of these symbols will be returned indicating which button was pressed The fourth argument is a symbol that must match one of the symbols in the list given in the third argument and specifies which button will be the default the one considered pressed if the user hits the Return key The fifth optional argument is a boolean value specifying whether or not to make the buttons all the same width or to vary their widths depending on the string labels default is to equalize the widths F Alter Reference Manual 133 User Requests user choose from list message labels values default cancel max lines buttons button values object Pops up a dialog window prompting the user to choose one element from a list or to cancel the decision The first argument is the string to serve as the message to prompt the user The second argument is a list of strings used to label the items in the list The
28. first of these the fourth argument to add interest is the depen dent In typical usage the lambda expression will execute some behavior on the dependent such as updating a property or re propagating the change in another direc tion If the dependent goes away for some reason DoME will automatically remove the dependencies registered againstit If a dependent needs to be able to selectively remove dependencies the optional sixth argument may be used to create such dependencies This same symbol can be given to remove interest The second aspect and optional fifth role arguments may be either strings or symbols Example Display a message to the user when the descrip tion changes add interest self description lambda changed object changed aspect old value message to user append old value gt description changed object self See also remove interest remove interestgrapething aspect interestedobject role nil Remove a previously created dependency on the first F Alter Reference Manual 87 Model Dependencies 88 argument The second argument indicates the aspect or property of interest all dependencies observing that aspect and whose dependent matches the third argument are removed If the optional fourth argument is supplied the dependencies must also have been created with that role If none of the dependencies match the pattern derived from the arguments no depende
29. form x y where x and y are both numbers rectangle object gt boolean Answers t if the argument is a rectangle f otherwise A rectangle is either a two element vector whose first ele ment is the upper left point and second element is the lower right point i e lt upper left x gt lt upper left y gt lt lower right x gt lt lower right y gt or a pair whose car is the upper left point and whose cdr is the lower right point i e lt upper left x gt lt upper left y gt lt lower right x gt lt lower right y gt Alter uses the convention that the x coordinates increase rightward whereas y coor dinates increase downward as do screen coordinates F Alter Reference Manual 125 Testing Geometric Objects 126 Testing Numbers num1 num2 num gt t or f This procedures returns t if its arguments are equal is transitive The traditional implementations of in Lisp like lan guages are not transitive While it is not an error to compare inexact numbers using the results may be unreliable because a small inaccu racy may affect the result this is especially true of even object t or f This procedure returns t if its argument is even a multi ple of 2 The result for inexact numbers may be unreli able because of small inaccuracies exact object gt t or f Exact provides a test for the exactness of a quantity For any Alter number
30. g new top model DFDGraph define n1 new in DFDProcess g 100 100 gt a process node define n2 new in DFDProcess g 300 100 gt a process node new in DFDDataflow g n1 n2 200 50 gt a dataflow arc with one bend point edit g new top model graphmodel class gt graphmodel Creates a new instance of the given graphmodel class and initializes it as a new top level model i e it has no par ent New top model does NOT open an editor window on the resulting instance The edit operation will do this See also new child model nodes arcs new in write bitmap graphmodel filename format nil Writes a bitmap of the graph into the specified filename using the indicated format Supported formats are cur rently gif mif Maker Interchange Format frame and framemaker are aliases xwd and eps Encapsulated PostScript epsf is an alias 86 NAN NANA NP Model Dependencies add interest grapething aspect lambda interestedobject role nil Create a dependency on the first argument so that an action is triggered when it changes Specifically the given lambda expression is executed every time the specified aspect of the object changes The lambda expression is passed the changed object the aspect that changed e g name and the previous value e g foo as parameters Two additional parameters are given to add interest to make it easier to remove the dependencies The
31. generate F Alter Reference Manual 89 Model Generating 9 Model Testing any changes graphmodel gt t or f Answer t if the graphmodel or any graphmodel in the model has any changes has name grapething t or f Answer t if the grapething has a name input and output graphboundary gt t or f Answer t if the graphboundary can be used as both an input and an output input only graphboundary t or f Answer t if the graphboundary can be used only as an input input graphboundary gt t or f Answer t if the graphboundary can be used as an input is kind of grapething class t or f Given an object and a class is kind of returns t if the object is an instance of the class and returns f if it is not Both the object must be an instance of some non basic class a basic class is one of the Scheme predefined types e g integer symbol string Is kind of is not defined on instances of basic classes logical top graph graphmodel gt t or f Answer t if the graphmodel is the logical top graph See logical top graph moveable graphobject gt t or f Answer t if the user may interactive move the graphob ject output only graphboundary gt t or f Answer t if the graphboundary can be used only as an output output graphboundary gt t or f Answer t if the graphboundary can be used as an output resizable graphobject t or f Answer t
32. gt 5 7 detect list predicate none object Detect is similar to select except that it returns the first object in the list that satisfies the predicate If no objects satisfy the predicate then the optional none argument is returned If the none argument is not specified then nil is returned member obj list list or f This procedure returns the first sublist of list whose car is obj where the sublists of list are the non empty lists returned by list tail arg2 k for k less than the length of list If obj does not occur in list then f not the empty list is returned Member uses equal to compare arg with F Alter Reference Manual 51 Enumerating the elements of list See also memq memv member list a b a c gt a c memq obj list list or f This procedure returns the first sublist of list whose car is obj where the sublists of list are the non empty lists returned by list tail list k for k less than the length of list If obj does not occur in list then f not the empty list is returned Memdq uses eq to compare obj with the ele ments of list See also memv member memg a a b c gt memq b ab c gt abc m b memq a b c d gt f c memq list a b a c gt f memg 101 100 101 102 gt unspecified memv obj list list or f This procedure returns the first sublist of list whose car is obj where the sublists of list are the non emp
33. gt unspecified eq gt unspecified eq 00 gt t eq 2 2 gt unspecified eq HA HA gt unspecified eq car car gt t let n 2 3 eq nn gt unspecified let x a eq x x gt t let x 0 eq x x gt t let p lambda x x eq pp gt t equal arg arg2 t or f Equal recursively compares the contents of pairs vec tors and strings applying eqv on other objects such as numbers and symbols A rule of thumb is that objects are generally equal if they print the same Equal may fail to terminate if its arguments are circular data structures equal a a gt t equal a a t equal a b c a b c gt t equal abc abc t equal 22 ft equal make vector 5 a make vector 5 a gt t equal lambda x x lambda y y unspecified eqv arg arg2 t or f The eqv procedure defines a useful equivalence relation on objects Briefly it returns t if arg1 and arg2 should 116 Testing normally be regarded as the same object This relation is left slightly open to interpretation but the following par tial specification of eqv holds for all implementations of Scheme The eqv procedure returns t if argl and arg2 are both t or both f argl and arg2 are both symbols and string symbol gt string arg1 symbol gt string arg2 gt t Note This assumes that neither arg nor arg2 is an
34. however a programmer may need to 20 call cc proc value Control deal with continuations explicitly Call with current con tinuation allows Scheme programmers to do that by cre ating a procedure that acts just like the current continuation Most programming languages incorporate one or more special purpose escape constructs with names like exit return or even goto In 1965 however Peter Landin invented a general purpose escape operator called the J operator John Reynolds described a simpler but equally powerful construct in 1972 The catch special form described by Sussman and Steele in the 1975 report on Scheme is exactly the same as Reynolds s construct though its name came from a less general construct in MacLisp Several Scheme implementors noticed that the full power of the catch construct could be provided by a procedure instead of by a special syntactic construct and the name call with current continuation was coined in 1982 This name is descriptive but opinions differ on the merits of such a long name and some people use the name call cc instead Proc must be a procedure of one argument The proce dure call with current continuation packages up the cur rent continuation see the rationale below as an escape procedure and passes it as an argument to proc The escape procedure is a Scheme procedure of one argument that if it is later passed a value will ignore whatever con
35. if the node may be resized by the user selected graphobject gt t or f Answer t if the graphobject is selected top model graphmodel t or f Answer t if the graphmodel is the top model F Alter Reference Manual 91 Model Testing visible graphobject t or f Answer t if the graphobject is visible 92 LA ZSS MA AN SI E Model User Interface bring to foc us grapevisualthing gt unspecified Raise open the graphmodel that has the grapething and then select the grapething clear selection graphobject unspecified De select the graphobject close model graphmodel gt unspecified Confirm any potential loss of data with the user and then close all editor windows open on any portion of the model data dictionary editgrapething unspecified Edit the grapething using the data dictionary editor deletion request grapething t or f Answer t if the user should be allowed to delete this gra pething deselect all graphmodel gt unspecified De select all graphobjects in the graphmodel display errors list nil The display errors procedure displays the given list of errors in a scrollable window so that the object with a problem can be directly inspected or focussed on The list is an association list where the car of each association is a GrapEVisualThing or a list of GrapEVisualThings and the cdr is an error message a string define g new top model DFDGraph
36. list including only the first k ele ments List tail could be defined by define list head lambda x k if or zero k null x list set cdr list car x list head cdr x k 1 list last list sexpr Returns the last element of list This is the same as list F Alter Reference Manual 65 Lists ref list length list 1 list ref a b c d gt d list ref gt nil Iist ref list index sexpr Returns the kth element of list This is the same as the car of list tail list k list ref a b c d 2 gt c list ref a b c d inexact gt exact round 1 8 gt c list tail list index list Returns the sublist of list obtained by omitting the first k elements List tail could be defined by define list tail lambda x k if zero k x list tail cdr x k 1 remove from list list object gt list Returns the argument list with all top level references to object removed using eq test Note that the return value will not be the same as the list passed in if the first element is eq to object This operation is destructive to the argument list so any references to list may also be affected The structure and values of the resulting list are the same as defined for copy without define foo a b c remove from list foo b gt a c foo gt a c define foo a b a c remove from list foo a gt b c foo gt ab c remove from list a b
37. ness preserving when its argument is real abs 7 gt 7 ceiling number number Ceiling returns the smallest integer not smaller than number The result is always exact ceiling 4 3 gt 4 ceiling 3 5 gt 4 denominator fraction gt integer This procedure returns the denominator of its argument the result is computed as if the argument was represented as a fraction in lowest terms The denominator is always positive The denominator of 0 is defined to be 1 denominator 6 4 gt 2 denominator exact gt inexact 6 4 gt 2 0 10 Arithmetic floor number number Floor returns the largest integer not larger than number The result is always exact floor 4 3 gt 5 floor 3 5 gt 3 gcd number number This procedure returns the greatest common divisor of its arguments The result is always non negative This pro cedure is exactness preserving gcd 32 36 4 ged gt 0 lem number number This procedure returns the greatest least common multi ple of its arguments The result is always non negative This procedure is exactness preserving Icm 32 36 gt 288 lem 32 0 36 gt 288 0 inexact lem gt 1 max number rest number This procedure returns the maximum of its arguments max 3 4 gt 4 exact max 34 1 gt 4 1 inexact min number rest number This procedure returns the minimum of its arguments min 3 4 gt 3 exact min 3
38. package package to use using package used package The packages to use argument should be a list of pack ages or package names or possibly a single package or package name These packages are added to the use list of package if they are not there already All external sym bols in the packages to use become accessible in package as internal symbols 100 AVE NAAN Y a Points point point1 point2 point This procedure returns the product of its argument points See point for an explanation of how points are represented in Alter point 5 2 3 4 gt 15 8 point 5 2 3 4 gt 15 8 point 5 2 3 gt 15 6 point 5 2 4 1 2 gt 20 16 point point1 point2 point This procedure returns the sum of its arguments where the first argument is a point and the rest of the arguments are points or numbers See point for an explanation of how points are represented in Alter point 1 2 3 4 gt 4 6 point 1 2 3 4 gt 4 6 point 1 2 3 4 gt 8 9 point 1 2 3 4 gt 8 9 point point1 point2 gt point This procedure returns the difference of its arguments where the first argument is a point and the rest of the arguments are points or numbers See point for an explanation of how points are represented in Alter point 5 2 3 4 gt 2 2 point 5 2 3 4 gt 2 2 point 5 2 3 4 gt
39. result makes this expression true If n is inexact the radix is 10 and the above expression can be satisfied by a result that contains a decimal point then the result contains a decimal point and is expressed using the minimum number of digits exclusive of expo nent and trailing zeroes needed to make the above expression true otherwise the format of the result is 28 Converting unspecified The result returned by number gt string never contains an explicit radix prefix The error case can occur only when n is not a complex number or is a complex number with a non rational real or imaginary part object gt string object gt string Returns a string representation of sexpr by the same mechanism that display formulates a string to display c f display string gt filename string resolve gt filename Converts the argument string into a filename object This procedure does not require the corresponding file to exist but an error may result if the syntax of the name is not appropriate for the host operating system Alternatively certain adjustments may be made when converting the string to a filename that make it more palatable to the host See also construct filename gt string string gt list string list String gt list returns a newly allocated list of the characters that make up the String gt given string String gt list and list gt string are inverses so far as String gt equal is con cerne
40. strings of the corresponding ordering on characters String ci gt is the lexicographic ordering on strings induced by the ordering char ci gt on characters If two strings differ in length but are the same up to the length of the shorter string the longer string is considered to be lexicographi cally greater than the longer string string ci gt string string2 gt t or f This procedure is a lexicographic extension to strings of the corresponding ordering on characters String ci gt is the lexicographic ordering on strings induced by the ordering char ci gt on characters If two strings differ in length but are the same up to the length of the shorter string the longer string is considered to be lexicographi cally greater than the longer string F Alter Reference Manual 129 Testing Strings string empty string1 gt t or f Returns t if the string is the empty string string empty abc gt f string empty gt t string string string2 t or f This procedure is a lexicographic extension to strings of the corresponding ordering on characters String lt is the lexicographic ordering on strings induced by the ordering char lt on characters If two strings differ in length but are the same up to the length of the shorter string the shorter string is considered to be lexicographi cally less than the longer string string lt string string2 gt t or f This procedure is a
41. subdiagram is added description proc string string description grapething string If the first argument is an instance of GrapEThing description returns the value a string of the description property of the object If the first argument is a procedure or operation and the optional second argument is miss ing description returns a string describing it Normally the description text is retrieved from the file construct construct dome home lib alterdsc txt but if the optional argument is supplied it becomes the description for the procedure or operation destination netarc gt node destination graphobjectreference node Given an arc the destination operation returns the node object that is at the destination end of the arc See also origin Given a GraphObjectReference destination returns the node for which the argument is a surrogate direction graphboundary symbol Returns a symbol representing the semantic direction of the given boundary node in a graph The possible values are in out and inout do over model grapething thunk nil Traverse the grapething s model and apply the thunk to each object contained in the model elements graphobject list Answer a list of nodes that are elements of the node Ele ments are nodes that are contained within the node face alter graphics context gt string face grapething string face document context string G
42. y coordi nates are equal to the larger of the print size divided by the rectangle s width or the print size divided by the rect angle s height The translation is set to the rectangle s upper left corner point negated set bottom margin document context inches gt nil Sets the size of the bottom margin for a page generated by the document context The size is in inches set face document context string gt nil Sets the name of the font family that the reliever should use when drawing strings with the draw string opera tion set indent level document context indent level nil Sets the value of the receiver s indent level The indent level is multiplied by the receiver s indent size to deter mine the total number of spaces to use when indenting set indent size document context indent level gt nil Sets the value of the receiver s indent size The indent size is multiplied by the receiver s indent level to deter mine the total number of spaces to use when indenting set left margin document context inches gt nil Sets the size of the left margin for a page generated by the receiver The size is in inches set line style document context symbol gt nil This operation sets the context s line style to the symbol argument The symbol represents the current dash pat tern to be used when drawing lines The symbol is one of normal simpledash longdash dot dashdot dashdotdot phantom chain shortdash hidden
43. 0 page height 46 page width 46 paint 105 paint color 105 paint style 106 pair 120 parent 80 parent connection 80 peek char 62 platform 73 point 102 102 point 101 point 101 point 101 point 102 point gt 102 point gt 102 point 125 point max 101 point min 101 port 46 port 121 position 80 positive 128 predefined bindings 38 print 93 print size 46 procedure 121 property schema files 81 provide 95 put string 46 Q quasiquote 39 quote 39 quotient 12 R radius 102 random 73 rational 128 rationale 81 read 62 read char 62 read through char 62 real 128 rectangle 125 red 18 refresh display 93 register 109 relative position 81 relative scale 81 remainder 12 remove 81 remove child 81 remove from list 66 remove interest 87 rename package 100 request directory name 133 request file name 133 request new file name 133 require 95 reset 62 reset environment 73 reset multilevel counter 46 resizable 91 resolve 54 resolve identity 81 return spec 74 reverse 67 right margin 46 round 13 route 81 S saturation 18 save 94 save as 94 scale 47 F Alter Reference Manual Index scale rectangle 108 scale to 47 select 52 selected 91 selected components 81 serif 55 set 40 set bold 55 set border bounds 81 set bottom margin 47 set car 67 set cdr 67 set color 82 set configurations 82 set container 82 set current binding 82 set current
44. 3 document generator named 89 document generators 89 dome home 53 dome version 73 do over model 77 draw arc 57 draw grapething 45 draw line 57 draw polyline 57 draw rectangle 57 draw string 57 E edit 60 edit name 93 elements 77 eof object 124 eq 115 equal 116 eqv 116 error 73 eval 24 even 127 exact gt inexact 27 exact 127 exists 53 exists 53 exp 71 expand rectangle 107 export 99 exported symbols 99 expt 71 extent 107 F face 77 family 55 filename 77 filename gt string 27 finalize 45 find operation 35 find package 99 find vacant position 78 fixed width 55 flatten 15 floor 11 flush 60 for each 24 frozen color 78 G gcd 11 generate 89 get property 78 get property definition 78 get property definitions 78 gettype 131 grape 119 graph 78 graph label 78 green 17 H has archetype 78 has binding 78 has binding named 78 has child 79 has name 91 has parent 79 has parent connection 79 has property set 79 head 53 height 107 hue 17 identifier 79 identity 109 if 25 implementations 79 import 99 inc indent level 45 incoming arcs 79 indent 45 indent level 45 indent size 45 inexact gt exact 27 inexact 127 initialize 131 in new environment do 25 in package 99 input 91 input and output 91 F Alter Reference Manual Index input only 91 input port 119 inspector edit 93 instances 79 integer gt char 28 integer 127 int
45. 4 lt n2 then quotient n1 n2 gt n3 For integers n1 and n2 with n2 not equal to 0 n1 n2 quotient n1 n2 remainder n1 n2 gt t provided all numbers involved in that computation are exact The value returned by quotient always has the sign of the product of its arguments remainder numerator divisor gt integer This exactness preserving procedure implements num ber theoretic integer division For positive integers n1 and n2 if n3 and n4 are integers such that n1 n2 n3 n4 and 0 lt n4 lt n2 then remainder n1 n2 gt n4 For integers n1 and n2 with n2 not equal to 0 n1 n2 quotient n1 n2 remainder n1 n2 gt t provided all numbers involved in that computation are exact Remainder and modulo differ on negative arguments the remainder is either zero or has the sign of the divi dend while the modulo always has the sign of the divi sor 12 round number integer sqrt number number Arithmetic remainder 13 4 gt 1 modulo 13 4 gt 3 remainder 13 4 gt 1 remainder 13 4 gt 1 remainder 13 4 gt 1 remainder 13 4 0 gt 1 0 inexact Round returns the closest integer to number rounding to even when number is halfway between two integers Round rounds to even for consistency with the default rounding mode specified by the IEEE floating point stan dard The result is always exact round 4 3 gt 4 round 3 5 gt 4 round
46. Introduction Alter is a variant of the Scheme language as defined by the Rf report and this manual is derived from that same report although the resemblence is remote We offer here our sincere gratitude to the Scheme team for designing and describing a very useful language that is also easy to implement Alter came out of our desire to get out of the business of writing hard wired back ends for DoME We used to write them in Smalltalk 80 DoME s host language and this kept us busy but not very motivated Every user wanted to generate something slightly different from his or her DoME models and they soon flooded us with special requests We needed to give our user s a way of doing this sort of thing themselves Thus Alter was born Our selection of a Scheme variant was influenced by the CAD Framework Initiative s CFI selection of Scheme as their offical extension language At that time CFI was specifying interfaces for an object oriented framework covering many of the same services we envisioned for DoME Naturally then many of the selection criteria cited by CFI were also appropriate for us simple syntax well defined semantics extensibility implementability and adaptability to a variety of programming paradigms e g functional object oriented declarative Our familiarity with the implementation of functional languages esp Common Lisp also nudged us toward Scheme Alter is anearly complete implementati
47. The following examples illustrate cases in which the above rules do not fully specify the behavior of eqv All that can be said about such cases is that the value returned by eqv must be a boolean eqv unspecified eqv 0 gt unspecified eqv lambda x x lambda x x gt unspecified eqv lambda x x lambda y y gt unspecified The next set of examples shows the use of eqv with pro cedures that have local state Gen counter must return a distinct procedure every time since each procedure has its own internal counter Gen loser however returns equivalent procedures each time since the local state does not affect the value or side effects of the procedures define gen counter lambda let n 0 lambda set n n 1 n let g gen counter equ g g gt t eqv gen counter gen counter gt f define gen loser lambda let n 0 lambda set n n 1 27 let g gen loser eqv g g gt t Testing eqv gen loser gen loser gt unspecified letrec f lambda if equ f g both f g lambda if eqv f g both g eqv f g gt unspecified letrec f lambda if eqv f g f both g lambda if eqv f g g both eqv f g gt f Since it is an error to modify constant objects those returned by literal expressions implementations are per mitted though not required to share structure be
48. an error occurs If a user defined binding does not exist but a predefined binding does Alter binds the symbol in the current lexical environment to a surrogate operation that allows the user to add methods without disrupting the space of predefined symbols a surrogate handles calls just like a normal operation except that it can forward calls to the predefined operation if it is given an object that falls outside of its interface range If neither a user defined or predefined binding exists Alter creates a new operation and binds it to the given symbol The return value of find operation is the new or existing operation or surrogate See also add method make find operation foo gt a new normal operation find operation foo gt the same normal operation find operation length gt a new surrogate opera tion find operation gt error a procedure lambda formals body procedure Formals should be a formal arguments list as described below and body should be a sequence of one or more expressions A lambda expression evaluates to a procedure The envi ronment in effect when the lambda expression was evalu ated is remembered as part of the procedure When the procedure is later called with some actual arguments the environment in which the lambda expression was evalu ated will be extended by binding the variables in the for mal argument list to fresh locations the corresponding actual argument values will be s
49. and not nil master self name setl namednode string string name setl graphmodel string gt string name seti graphobjectattribute string string name setl user defined type string gt string name seti nameddirarc string string Obsolete Use set name instead name sourte grapething gt grapething Answer the grapething from which the name is really coming from nodes graphmodel list The nodes operation retrieves the list of nodes contained in the given graphmodel instance Only the nodes at the top level within the given graphmodel are returned the list does NOT contain any nodes from subdiagrams See also arcs open models list This procedure returns a list of graphmodel instances that are currently open but not necessarily displayed within DoME origin netarc gt node Given an arc the origin operation returns the node object that is at the origin end of the arc See also destination outgoing arcs domenode gt list Given a node instance the outgoing arcs operation returns a list of the arcs emanating from the node See also incoming arcs parentgraphmodel graphobject Returns the parent of the given graph if any If the argu ment has no parent nil is returned parent connection graphobject graphobject Parent connection is an operation defined on nodes and arcs that returns the corresponding object in the parent diagram if any For example the parent connection of a bo
50. anta Akan AA 69 20 Math Functions sssssnssennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnn 71 21 MiscelaneoUS sssssssssesnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnn 73 22 Model Ac cessing sssssssnnnsnennnnnnnnnnnnnnnnnnnnnnnnnnnn nnn 75 23 Model C reation mcccccocnnananccnnnanannnrnnnananonrnnannanes 85 24 Model DependencieS oomccccccononannncnnnnanonrnnaananes 87 25 Model Generating mmccccconnancccnnancnnnennnanannerananaanos 89 26 Model T SUNQ cccocooccnccccnonnancnonnananonennnnanonrnnanaanes 91 27 Model User Inte fACE sssssssesunnnnnnnnnnnnnnnnnnnnnnnnnnnnn 93 D SMF Alter Reference Manual iii Contents 28 Modules crias nic n ia n nn n n n il a n n 95 29 OSINterfACE 0uaeaaaarannn anan aannn nna nsanna A 97 30 Pac KAGES atak patat aa AAA 99 31 Pol ai kaka kasika saaa kaa kika kosa kn 101 32 Printer DiiVeTooacconccononnnnnccnnnnnnnonronannnnnrrnnananannnns 105 33 Recital Sekirite piston akte okin es anka konn 107 34 Reg SUY oak artik aa kaa 109 FA ANE Saa ao 111 36 SANS eki k s ion koko akasan kaaokank sonnen ai nieokisisontavik 113 SITO k ken adds 115 38 Testing Characters 000rrrereraanrrasaasnnnnnannannnnnnan 123 39 Testing Geometric Objects coccccnconcancnonnanannnnnss 125 40 Testing NuMbeBS mccooooncnccconnnnnccnnnnnanonrnnanaaneness 127 41 Testing SUINGS occccccononnnnccnnnnnnonennnnanorrnnanaannnens 129 42 TY DOS isso 131 43 User REQUCSES wicccccsccssssseseeesseseeeeesseeeeeeeeeseeseesees 133 AA VO YA 135
51. aphics context between the two supplied points see point This primitive is used mainly in user defined DoME Tool Specification ProtoDoME methods draw polyline context point list fill nil draw polyline document context point list fill J gt nil Draws a polyline on the given graphics context between the supplied points see point This primitive is used mainly in user defined DoME Tool Specification ProtoDoME methods draw rectangle context rectangle I fill nil draw rectangle document context rectangle I fill l gt nil Draws a rectangle on the given graphics context If the fill flag is true the rectangle will be filled otherwise only the border will be drawn draw string context string point gt nil draw string document context string alignment loc extent nil Renders the string at the specified position on the graph ics context The position specifies the location of the left side and baseline of the first character F Alter Reference Manual 57 Graphics 58 I O char ready port gt t or f Returns t if a character is ready on the input port and returns f otherwise If char ready returns t then the next read char operation on the given port is guaranteed not to hang If the port is at end of file then char ready returns t Port may be omitted in which case it defaults to the value returned by current input port close port gt nil Closes the file asso
52. ar black nil dictionary ref nob black gt 00 0 F Alter Reference Manual 43 Dictionaries Document Generation bottom ma gin document context inches Returns the size of the bottom margin in inches for a page generated by the document context Crdocument context integer gt nil Adds a carriage return newline to the document con text s stream If the optional positive integer argument is passed then a number of carriage returns equal to the value of the integer are added to the document context s stream dec indent level document context gt nil Decrements the document context s indent level counter draw grapething ps context object translation nil draw grapething document context object translation gt nil Renders the grapething at the specified position on the graphics context finalize ps context gt nil finalize document context gt nil This is the call that is made to the document context after the document has been generated It is used to close files etc inc indent level document context gt nil Increments the document context s indent level counter indentdocument context gt nil Adds a number of spaces equal to the value of the receiver s indent level multiplied by its indent size to the receiver s stream indent level document context gt nil Returns the value of the receiver s indent level The indent level is multiplied by the receiver s inden
53. ar a car b gt bar 100 foo 56 zip 8 Sort will fail to terminate if it is given a circular list The sort procedure uses a quicksort algorithm F Alter Reference Manual 67 Lists 68 AOS MNAN EZENN EP Logic and args object or f The test expressions are evaluated from left to right and the value of the first expression that evaluates to a false value is returned Any remaining expressions are not evaluated If all the expressions evaluate to true values the value of the last expression is returned If there are no expressions then t is returned and 22 gt 2 1 gt t and 2 2 lt 2 1 gt t and 1 2 c f g gt t and gt t not object gt t or f Not returns t if obj is false and returns f otherwise not t gt f not 3 gt f not list 3 gt f not f gt t not gt f not list gt f not nil gt f or expressions gt object or f The test expressions are evaluated from left to right and the value of the first expression that evaluates to a true value is returned Any remaining expressions are not evaluated If all expressions evaluate to false values the value of the last expression is returned If there are no expressions then f is returned or 2 2 gt 2 1 gt t or 2 2 lt 2 1 gt t or f f f gt f or memq b a b c 30 gt b c
54. aracter objects appear in the representa tion as if written by write char instead of by write Dis play returns an unspecified value The port argument may be omitted in which case it defaults to the value returned by current output port editgraphmodel gt unspecified edit filenameorstring nil flush port gt nil Given a GraphModel instance the edit operation forces the given graphmodel instance to be assigned an editor window if it doesn t already have one and then forces that window to be popped to the front If the graph does not already have a window the behavior of the edit oper ation follows what is described in the DoME User s Man ual for the preferences setting Use Same Editor Given a string the edit operation treats the string as the name of a file and attempts to open an editor on the file s contents If the file contains a DoME model the opera tion is the same as edit load string If the file contains Alter text and the first character in the file is a semico lon DoME will open an Alter evaluator window on the file s contents If neither of the above is true DoME gives the user the option of opening the file into a text editing window Flushes any output that may have been buffered for the specified output port but not yet written to the device either a file or window The port is not closed It is an error to apply flush to an output port that has already been closed load fil
55. ay vector Returns a list containing a representation of the current system date The list is interpreted as follows year day of year dome version gt string Returns a string that represents the version of DoME being used error error message gt string This procedure stops execution and displays the Alter Environment Browser Activation Stack with the argu ment as the text in the message box interface proc list Given a procedure interface returns a string representing its interface Given an operation interface returns a list of the classes that the operation is defined on message to user message gt string Writes the specified string to the DoME message pane in the DoME Launcher window followed by a newline platform association Return an association where the association is made up of a symbol representing the kind of operating system of the platform win32 unix mac and a string that provides more detail about the platform such as version or detailed operating system name random low high number Returns a random number With no arguments the returned value is a floating point number evenly distrib uted between 0 0 and 1 0 With two integer arguments the returned value is an integer evenly distributed between the two given values inclusive The first argu ment must be less than the second argument reset environment gt Resets the registry default input p
56. ce shell command args integer Synchronously executes the command with the string args and returns its exit status as an integer Zero usually means success non zero means failure F Alter Reference Manual 97 OS Interface 98 Packages all packages list Returns a list of all packages currently defined in the sys tem current package package Answer the package that symbols are searched for and created in by default delete package package name gt package The package argument may be either a package or the name of a package If the package specified for deletion is currently used by other packages unuse package is per formed on all such packages so as to remove their depen dency on the specified package exportsymbol package package The symbols argument should be a list of symbols or pos sibly a single symbol These symbols become accessible as external symbols in package exported symbols package name list Returns a list of all symbols exported by package find package package name package The package argument should be a string or symbol The package with argument as a name is returned if no such package exists an error is signaled If the argument is a package object then the argument is returned importsymbols exporting package importing package package The symbols argument should be a list of symbols or pos sibly a single symbol The exporting pac
57. ciated with port rendering the port incapable of generating characters This routine has no effect if the port has already been closed The value returned is unspecified close input portport nil Closes the file associated with port rendering the port incapable of generating characters This routine has no effect if the port has already been closed The value returned is unspecified close output portport nil Closes the file associated with port rendering the port incapable of generating characters This routine has no effect if the port has already been closed The value returned is unspecified commitport gt nil Force all buffered output to be committed so no output is left buffered contents filename string contents port gt string Returns the contents of the specified filename If the file does not exist Alter will raise an error current input port gt input port or nil Returns the current default input port Alter does not always have a default input port so the return value may be nil See with input from file current output port gt output port Returns the current default input or output port See with output to file display object port gt nil Writes a representation of sexpr to the given port Strings that appear in the written representation are not enclosed in doublequotes and no characters are escaped within F Alter Reference Manual 59 I O those strings Ch
58. d string gt number string radix number Returns a number of the maximally precise representa tion expressed by the given string Radix must be an exact integer either 2 8 10 or 16 If supplied radix is a default radix that may be overridden by an explicit radix prefix in string e g o177 If radix is not supplied then the default radix is 10 If string is not a syntactically valid notation for a number then string gt number returns f string gt number 100 gt 100 string gt number 100 16 gt 256 string gt number le2 100 0 Although string gt number is an essential procedure an implementation may restrict its domain in the following ways String gt number is permitted to return f when ever string contains an explicit radix prefix If all numbers supported by an implementation are real then string gt number is permitted to return f whenever string uses the polar or rectangular notations for complex numbers If all numbers are integers then string gt number may return f whenever the fractional notation is used If all numbers are exact then string gt number may return f whenever an exponent marker or explicit exactness prefix F Alter Reference Manual 29 Converting is used or if a appears in place of a digit If all inexact numbers are integers then string gt number may return f whenever a decimal point is used string gt symbol string symbol Returns the symbol wh
59. d the new association is established Dictionary set returns f if there was no previous association for that key and returns t if there was a previous association for that key See also make dictionary dictionary ref dictio nary keys dictionary unset define table make dictionary eq dictionary set table small helvetica 9 0 gt f F Alter Reference Manual 41 Dictionaries dictionary set table small times 10 0 5 gt t dictionary unset dictionary key gt t or f Removes any association that may have previously existed for the given key in the given dictionary If an association existed for the key at the time of call to the dictionary unset the procedure returns t otherwise it returns f The comparison used to match the key is either eq or equal depending on how the dictionary was created see make dictionary See also dictionary ref dictionary set dictionary keys define sys table make dictionary eq dictionary unset sys table foo gt f dictionary set sys table foo 97 dictionary unset sys table foo gt t dictionary values dictionary list Returns a list of the values defined in the given dictio nary The values appear in the list in no particular order and that order may change with the addition or removal of a single key value pair In fact there is no guarantee that successive calls to dictionary values on the same dic tionary will produce the sam
60. dexing define f make string 3 define g string set f 0 gt unspecified string set g 0 gt error string set symbol gt string immutable 0 A gt error substring string start end string Substring returns a newly allocated string formed from the characters of string beginning with index start inclu sive and ending with index end exclusive substring abcdefg 2 4 gt cd F Alter Reference Manual 113 Strings substring abc 2 4 gt error substring abc 0 3 gt abc substring index string substring start number or nil Returns the zero based index of the first occurrence of the specified substring in the argument string If start is spec ified the search begins at that index rather than at the beginning Nil is returned if the substring does not occur in the searched range or if the specified start index is past the end of the string substring index abcdefg cd gt 2 substring index abcdabcd cd 4 gt 6 substring index qrs cd gt nil 114 AZ S WA VAY CA NS Testing boolean object gt t or f Boolean returns t if sexpr is either t or f and returns f otherwise boolean f gt t boolean 0 gt f boolean Y gt f bound symbol t or f Returns t if the symbol is bound to a value in the current lexical environment otherwise returns f char object gt t or f Returns
61. didah gt dah dah didah F Alter Reference Manual 31 Converting 32 Defining add method interface body procedure Adds the specified procedure as a handler for the method named in the interface argument Alter s implementation of classes operations and methods follows the OakLisp style as presented in the OOPSLA 86 Proceedings The detailed form of the arguments to add method are as follows add method operation receiver class argu ment list body Add method is a special form because the body and argu ment list are not evaluated However the operation and receiver class ARE evaluated They are typically symbols bound to the objects of interest This means of course that the operation must previously exist before add method can be used to add to it see find operation make The argument list is used to effectively build a procedure that also includes the body This procedure is returned as the result of add method When the operation is called with an instance of the receiver class or a subclass as the first argument Alter will forward the call to the procedure bindings list Returns a list of pairs that represent the user defined bindings within the active lexical environment Each pair has a car that is a symbol and a cdr that is the value bound to that symbol Predefined procedures and opera tions are NOT included in this list see predefined bind ings cop
62. display errors list list g Name Required edit name grapevisualthing unspecified Open a dialog to allow the user to rename the object inspector edit grapevisualthing gt unspecified Edit the grapething using the inspector editor move to back graphobject unspecified Move the graphobject behind all other graphobjects move to front graphobject unspecified Move the graphobject in front of all other graphobjects print graphmodel unspecified Open a dialog to allow the user to print the graphmodel refresh display grapevisualthing gt unspecified Redraw the given object F Alter Reference Manual 93 Model User Interface save graphmodel unspecified Save the graphmodel If the graphmodel has never been saved then open a dialog to allow the user to save the graphmodel Save asgraphmodel gt unspecified Open a dialog to allow the user to save the graphmodel set selection graphobject gt unspecified Select the graphobject square route netarc gt unspecified Square the route of the netarc synchronize display graphmodel nil If the given graphmodel has an editor window open syn chronize display brings it up to date by forcing all pend ing graphic operations to complete The precise behavior of this operation is host specific 94 8 ZAZ DAN MAN SIL XV Modules loaded modules gt list Returns a list of the modules currently loaded in the sys tem provide m
63. e Given an instance of a node the archetype operation returns either nil if the node has no archetype or the node instance that serves as the argument s archetype An archetype is a node that resides on the shelf see the DoME User s Manual By definition the archetype of an archetype is itself archetype shelf graphmodel gt graphmodel Answer the archetype page associated with the graph model archetype graphobject gt t or f archetype graphmodel t or f archetype remotegraphobject gt t or f Is the object an archetype archetypifiable graphobject gt t or f Answer t if instances of the grapething s class can be archetypes arcs graphmodel list Given a GraphModel instance the arcs operation returns a list of the arcs present in the graph The list includes only the arcs at the top level within the given graph it does NOT contain any arcs from subdiagrams See also nodes F Alter Reference Manual 75 Model Accessing baseline graphobject integer baseline graphmodel gt integer Answer the distance from the top of the line to the bottom of most of the characters by convention bottom of A in the current style used by the model to render text binding named grapething string modelbinding Answer the binding whose configuration is as specified border bounds domenode rectangle Returns a rectangle list of the form x1 y1 x2 y2 that is used as a startin
64. e Directly through an Alter evaluator window e Each time DoME starts up by creating a DOME startup script e As a user defined plug in function e As a printer driver e InaProtoDoME model Syntax alphal 17 3 1415927 foo ees o 0 a string MYE Nc Nspace Hen t f nil F Alter Reference Manual identifier lt gt _ amp additional valid identifier characters integer float symbol list list constant empty list different from nil vector constant string constant string with special character character constant space character also delete formfeed backspace escape newline tab alternate radix numeric constant where r is b binary o octal d decimal or x hexadecimal true value false value undefined value Syntax WA ANI AA NP Reserved Words List of Alter Reserved Words gt do letrec add method else or and find operation quasiquote begin if quote case lambda set cond let unquote define let unquote splicing delay 2 Some of these reserved words are not yet supported F Alter Reference Manual 5 Reserved Words Notation Conventions procedure name argument specification D return type operation name argument specification return type An argument specification is a series of the following forms argtype type of the argument argl arg2 optional arguments
65. e ordering See also make dictionary dictionary ref dictionary set dictionary unset dictionary keys let dict make dictionary eq dictionary set dict alpha one dictionary set dict beta two mon dictionary values dict gt one two make dictionary comparison size J dictionary Make dictionary has two optional arguments The first currently required to be either eq or equal specifies the kind of comparison used on keys to search for and retrieve values from the dictionary Equal does not cur rently work for keys that are lists Eq is the default If the second argument is also given it must be a positive integer and indicates the allocation size of the dictionary to create The allocation size is the number of key gt value associations that may be made before the dictionary must be automatically and invisibly enlarged Since dictio nary enlargement can involve a lot of copying and may significantly overshoot in size you may gain some per formance for large dictionaries if you give a reasonably close but conservative estimate in the second argument to make dictionary define baz make dictionary small dictionary using eq for key comparison 42 Dictionaries dictionary set baz black 0 0 0 define nob make dictionary equal gt small dictionary using equal for key comparison dictionary set nob black 0 0 0 dictionary ref b
66. e package newline port nil Writes an end of line to port Exactly how this is done dif fers from one operating system to another Returns an unspecified value The port argument may be omitted in which case it defaults to the value returned by current output port open input file filename input port open input file string gt input port Takes a string or filename representing an existing file and returns an input port capable of delivering characters from the file If the file cannot be opened an error is sig nalled open input string string input port Opens an input port on the string argument open output file filename gt output port open output file string gt output port Takes a string or filename representing an output file to be created and returns an output port capable of writing characters to a new file by that name If the file cannot be opened an error is signalled If a file with the given name already exists the effect is unspecified If the string is passed as the argument then a transcript window is opened and its port is returned open output string gt output port Opens an output port on the string argument F Alter Reference Manual 61 I O peek char port character Returns the next character available from the input port without updating the port to point to the following char acter If no more characters are available an end of file object is retu
67. each v is the corresponding value at that key Note that the result list is in a conve nient form for using with assoc assv and assq dictionary keys dictionary list Returns a list of the keys defined in the given dictionary The keys appear in the list in no particular order and that order may change with the addition or removal of a single key In fact there is no guarantee that successive calls to dictionary keys on the same dictionary will produce the same ordering See also make dictionary dictionary ref dictionary set dictionary unset dictionary values let dict make dictionary eq dictionary set dict alpha one dictionary set dict beta two dictionary keys dict gt alpha beta dictionary ref dictionary key default object If the given dictionary has a value associated with the given key that value is returned If the key has no associ ated value either the default if supplied or nil is returned See also make dictionary dictionary set dic tionary keys dictionary unset define foo make dictionary eq dictionary set foo 10 ten dictionary ref foo 10 gt ten dictionary ref foo x gt nil dictionary ref foo x nothing gt nothing dictionary set dictionary key obj gt t or f Inserts the given object into the dictionary associated with the given key If the key previously had an associated value in the dictionary that previous association is broken an
68. ed by the empty list For this reason it may take list a fair amount of time to determine its answer if given a very long list list abc gt t list gt t list a b gt f let x list a set cdr x x list x gt f nil object gt t or f Returns true if the given object is eq to the nil object there is only one in Alter Returns false otherwise null object gt t or f Returns t if sexpr is the empty list otherwise returns f number object gt t or f Number can be applied to any kind of argument includ ing non numbers It returns t if the object is a number and otherwise it returns f number a gt f number 3 gt t number 3 1415 gt t object object gt t or f Returns true for any Alter object operation object t or f Returns true if the given object represents an operation as defined by make or find operation returns false other wise operation new in gt t operation car gt f output port object gt t or f Returns t if the given port is an output port otherwise returns f See open output file and terminal pair object gt t or f Pair returns t if sexpr is a pair and otherwise returns f If list foo is true then pair foo will be true pair a b gt t pair abc gt t pair gt f 120 Testing pair ab gt port object t or f Retur
69. enameorstring loudly modified object or grapething 60 The load procedure reads expressions and definitions from the file and evaluates them sequentially It is unspecified whether the results of the expressions are printed The load procedure does not affect the values returned by current input port and current output port Load returns an unspecified value The argument may be either a string or a filename instance see string gt file name If the file name is a relative pathname DoME searches a sequence of directories The sequence is determined by the contents of the global symbol dome load path plus the default directories obtained through the expression construct construct construct dome home tools en lib The directories given in dome load path if any are searched first in order followed by the default directo I O ries You can set dome load path in your DoME initial ization file see the DoME User s Manual name namednode string name package gt string name graphmodel string name graphobjectattribute gt string name port gt string name nameddirarc gt string name user defined type gt string Returns a string representing the name of the given gra pething instance The name operation is defined on classes NamedNode GraphObjectAttribute Named DirArc GraphModel and their subclasses See also set name When given a package it returns the name of th
70. eneral construct in MacLisp Several Scheme implementors noticed that the full power of the catch construct could be provided by a procedure instead of by a special syntactic construct and the name call with current continuation was coined in 1982 This name is descriptive but opinions differ on the merits of such a long name and some people use the name call cc instead cond clause object or nil Each clause should be of the form test expression where test is any expression The last clause may be an else clause which has the form else expression expression2 A cond expression is evaluated by evaluating the test expressions of successive clauses in order until one of them evaluates to a true value When a test evaluates to a true value then the remaining expressions in its clause are evaluated in order and the result of the last expres sion in the clause is returned as the result of the entire cond expression If the selected clause contains only the test and no expressions then the value of the test is returned as the result If all tests evaluate to false values and there is no else clause then the result of the condi tional expression is unspecified if there is an else clause then its expressions are evaluated and the value of the last one is returned cond gt 3 2 greater lt 3 2 less gt greater cond gt 3 3 greater lt 3 3 less else equal gt equal do bindings ter
71. er graphics context t or f Given a graphics context instance the landscape opera tion returns a boolean value indicating whether or not the user selected landscape orientation in the print dialog This operation is useful primarily in user defined DoME printer drivers See appendix line style alter graphics context symbol This operation returns a symbol representing the current dash pattern to be used when drawing lines The symbol returned is one of normal simpledash longdash dot dash dot dashdotdot phantom chain shortdash hidden line width alter graphics context integer Given a graphics context instance the line width opera tion returns an integer value indicating how many pixels wide the pen is for drawing lines This operation is useful primarily in user defined DoME printer drivers See appendix paintalter graphics context array Given a graphics context instance the paint operation returns a two element vector the first value is a color value instance representing the current pen color for drawing objects and the second value is a symbol repre senting the pen stroke style solid or gray This opera tion is useful primarily in user defined DoME printer drivers See appendix See also paintcolor paintstyle The result of the paint operation is the same as the follow ing where gc is the graphicscontext instance let p make vector 2 vector set p 1 paintcolor gc vector set
72. erface 73 is a 119 is kind of 91 italic 55 ivars 131 L lambda 35 landscape 105 lcm 11 left margin 45 length 16 let 36 let 37 letrec 37 line style 105 line width 105 list 65 list gt string 28 list gt vector 28 list 120 list head 65 list last 65 list ref 66 list tail 66 load 60 loaded modules 95 load path 54 log 71 logical top graph 79 logical top graph 91 lower left 107 lower right 107 M magenta 17 make 38 make cmy color 17 make color 17 make dictionary 42 make directory 54 make hsb color 18 Index 139 Index make package 99 make rgb color 18 make string 113 make vector 135 map 25 master 79 max 11 member 51 memq 52 memv 52 merge file 85 message to user 73 methods 38 min 11 modulo 11 moveable 91 move to 54 move to back 93 move to front 93 name 61 name set 80 name source 80 negative 127 new child model 85 new in 85 newline 61 new settings 89 new top model 86 next multilevel tag 46 next put 46 nil 120 nodes 80 not 69 null 120 number gt string 28 number 120 numerator 12 O object gt string 29 object 120 odd 128 open 46 open client socket 111 open input file 61 open input string 61 Index 140 open models 80 open output file 61 open output string 61 operation 120 or 69 origin 80 outgoing arcs 80 output 91 output only 91 output port 120 P package name 100 package used by list 100 package use list 10
73. fied amount The scale is speci fied as a point or number See rectangle scale rectangle 3 8 5 12 1 2 gt 3 16 5 24 scale rectangle 3 8 5 12 5 gt 15 40 25 60 translate rectangle rectangle translation rectangle Returns a new rectangle which represents the given rect angle translated by the specified amount The translation is specified as a point See rectangle The height and width of the new rectangle are the same as the argument translate rectangle 3 8 5 12 1 2 gt 4 10 6 14 upper left rectangle number Returns the upper left corner of the rectangle see rectan gle upper left 3 8 5 12 gt 3 8 upper left 3 8 5 12 gt B 8 upper night rectangle number Returns the upper right corner of the rectangle see rect angle upper right 3 8 5 12 gt 6 8 upper right 3 8 5 12 gt 5 8 width rectangle number Returns the width in the x dimension of the supplied rectangle see rectangle width 3 8 5 12 gt 2 width 3 8 5 12 gt 2 108 Registry identity identifier object Return the object from the registry that has the given identifier register object identifier Add the object to the registry and return an identifier that may be used later for lookup unregister identifier gt nil Remove
74. g class propertyname propertydefintion or nil Return the property definition for the named property get property definitions grapething categoryname dictionary get property definitions grapething class dictionary Return all or those that have a category of catego ryname of the property definitions for the specified object graph grapething graphmodel Returns the graphmodel containing the object if any Returns nil if the object cannot be traced back to any graph The graph of a graphmodel is itself graph label graphmodel node Answer the graphlabel of the graphmodel has archetype graphobject t or f Answer t if the graphobject has an archetype has binding named grapething string gt t or f Answer t if the grapething has a modelbinding with a configuration as specified has binding grapething t or f Answer t if the grapething has at least one modelbind ing 78 Model Accessing has child graphobject gt t or f Answer t if the graphobject has subdiagrams has parent connection grapething t or Hf Answer t if the grapething has a parent connection has parent grapething gt t or f Answer t if the grapething has a parent has property set grapething propname boolean has property set propname grapething boolean Returns t if the given grapething object has a value set for the named property Itis an error if the property name is not valid for the
75. g point for drawing the object s outline Units are pixels bounds grapething rectangle Returns a rectangle see rectangle that represents the node s outer dimensions including the name if any Units are pixels colorgraphobject color value colorfont description color value Returns a color value representing the color of the font or graph object components grapething list Given a GrapeThing instance the components operation returns a list of the components contained within the instance For GraphModels the list will contain nodes and arcs For nodes the list will contain nodes For arcs the list may contain nodes and a GrapEArcName configurations graphmodel list configurations grapething list Answer the configurations that are available to be used throughout the model container graphobject gt visualgrapething The container operation is an inverse to the components method Given a GrapEThing instance it returns the object that contains it The returned object may be a DoMENode NetArc or GraphModel instance See com ponents current binding graphmodel gt modelbinding Answer the modelbinding that matches the graphmodel s current state current configuration graphmodel string Answer the configuration string that the graphmodel has active 76 Model Accessing default c hild type graphobject gt graphmodel class Returns the default type of graphmodel created when a new
76. ght sides are expanded outward by the amount specified in the x component of the point and the top and bottom sides are expanded outward by the amount speci fied in the y component of the point If the expansion is a rectangle then the left top right and bottom sides of the first argument are expanded by the amounts specified for the left top right and bottom of the expansion expand rectangle 3 8 5 12 1 gt Q 7 6 13 expand rectangle 3 8 5 12 1 2 gt Q 6 6 14 expand rectangle 3 8 5 12 1 2 3 4 gt 2 6 8 16 extentrectangle number Returns the extent a point whose x represents the width and whose y represents the height of the supplied rectan gle see rectangle extent 3 8 5 12 gt 2 4 heightrectangle number Returns the extent of the image in the y vertical direc tion lower left rectangle number Returns the lower left corner of the rectangle see rectan gle lower left 3 8 5 12 gt 3 12 lower left 3 8 5 12 gt 3 12 lowerright rectangle number Returns the lower right corner of the rectangle see rect F Alter Reference Manual 107 Rectangles angle lower right 3 8 5 12 gt 5 12 lower right 3 8 5 12 gt G 12 scale rectangle rectangle scale rectangle Returns a new rectangle which represents the given rect angle scaled by the speci
77. given class of object The DoME Tool Specifications define the properties on the various DoME objects The property name which IS case sensi tive can either by a string or a symbol identifier grapething number Answer a number that uniquely identifies the grapething in the model implementations graphobject list If aGraphObject has an archetype then this returns the archetypes s implementations Otherwise it returns aGraphObject s subdiagrams incoming aics domenode gt list Given a node instance the incoming arcs operation returns a list of the arcs entering the node See also out going arcs instances domenode list The argument to the instances operation must be an archetype that is a node that resides on the shelf see the DoME User s Manual The instances operation will return a list of all of the archetype s instances See also archetype logical top graph graphmodel graphmodel Answer the logical top graphmodel The logical top graphmodel corresponds to the topmost graphmodel in a hierarchy whose subtree of graphmodels forms one model that is a cohesive set of interrelated graphmod els that are all from the same notation family mastergrapething gt grapething Returns the instance that serves as the master for the given object The following expression will always be true memq self views master self F Alter Reference Manual 79 Model Accessing where self is a graphobject instance
78. ing a lambda expression is tagged with a storage location in order to make eqv and eq work on procedures let bindings body object Bindings should have the form variablei initi 36 Defining where each initi is an expression and body should be a sequence of one or more expressions It is an error for a variable to appear more than once in the list of variables being bound The inits are evaluated in the current environment in some unspecified order the variables are bound to fresh locations holding the results the body is evaluated in the extended environment and the value of the last expres sion of body is returned Each binding of a variable has body as its region let x 2 y 3 Fx y gt 6 let x 2 y 3 let x 7 z xy zx gt 35 let bindings body object Bindings should have the form variablei initi and body should be a sequence of one or more expres sions Let is similar to let but the bindings are performed sequentially from left to right and the region of a binding indicated by variable init is that part of the let expres sion to the right of the binding Thus the second binding is done in an environment in which the first binding is visible and so on let x 2 y 3 let x 7 2 xy zx gt 70 letrec bindings body gt object Bindings should have the form variablei initi and body should be a
79. irst argument saturation value is the second argument and brightness value is the third argument make rgb color red green blue color red color type number Creates a color value object whose red value is the first argument green value is the second argument and blue value is the third argument Returns a number between 0 and 1 representing the red component of the given color value see also blue green Color values are usually obtained via a GraphicsContext instance used when printing graphs through user sup plied print drivers saturation color type number Returns a number between 0 and 1 representing the satu ration component of the given color value see also hue brightness Color values are usually obtained via a GraphicsContext instance used when printing graphs through user supplied print drivers yellow color type number 18 Returns a number between 0 and 1 representing the yel low component of the given color value see also cyan magenta Color values are usually obtained via a Graph icsContext instance used when printing graphs through user supplied print drivers Control ge BZ NA NANO S V apply proc list object QQ Calls proc with the elements of list as the actual argu ments apply list 3 4 gt 7 define compose lambda f g lambda args f apply g args compose sqrt 12 75 gt 30 begin body object or nil The expression a
80. ist are inserted in place of comma at sign expression sequence list 12 4 let name a a 12 map abs 4 5 6 b gt a 3 45 6 b foo 10 3 cdr c car cons foo 7 cons 10 5 sqrt 4 map sqrt 16 9 8 gt 10 5 2 4 3 8 Quasiquote forms may be nested Substitutions are made only for unquoted components appearing at the same nesting level as the outermost backquote The nesting level increases by one inside each successive quasiquota tion and decreases by one inside each unquotation a b 1 2 foo 1 3 d e f gt a b 1 2 foo 4 d e f let namel x gt list 3 4 list name name gt list a quote a SES e name2 y a b namel name2 d e gt a b x y d e The notations lt template gt and quasiquote lt template gt are identical in all respects lt expression gt is identical to unquote lt expression gt and lt expression gt is identical to unquote splicing lt expression gt The external syntax generated by write for two element list whose car is one of these symbols may vary between implementations quasiquote list unquote 1 2 4 gt list 3 4 quasiquote list unquote 1 2 4 gt list 1 2 4 quote object object Returns the argument The argument may be any exter nal representation of an Alter object This notation is used t
81. iven a graphics context instance the face operation returns a string representing the current typeface for dis playing text objects This operation is useful primarily in user defined DoME printer drivers See appendix The possible return values are Helvetica Times Courier and Palatino filename graphmodel filename type Given a graph model instance the filename operation F Alter Reference Manual 77 Model Accessing returns an instance of filename type that represents the file the model was last saved in find vac ant position graphmodel width height gt point Answer a position point in the graph that can contain an object with the given width and width frozen colorgraphobject gt t or f Answer t if the color of the graphobject should not change through indirect means get property object propname object get property propname object object Gets the value of the named property from the given object The object is usually an instance of grapething or one of its subclasses but get property will also work on instances of other GrapE classes It is an error if the prop erty name is not valid for the given class of object The DoME Tool Specifications define the properties on the various DoME objects The property name which IS case sensitive can either by a string or a symbol get property definition grapething propertyname propertydefinition or nil get property definition grapethin
82. kage argument is the package that the symbols are being imported from These symbols become internal symbols in importing package and can therefore be referred to without having to use qualified name colon syntax in package package name 5 package This procedure currently does nothing except yield a nil return value It is included for compatibility with emacs lisp modes make package package name gt package This creates and returns a new package with the specified package name The argument may be either a string or a symbol F Alter Reference Manual 99 Packages package name package gt string Answer the name of the package package use list package package Returns a list of packages used by package package used by list package package Returns a list of packages the use package rename package package new package name gt package The new argument should be a string or symbol The package argument is a string symbol or package object The old name is eliminated and replaced by new unexportsymbol or list package package The argument should be a list of symbols or possibly a single symbol These symbols become internal symbols in package unuse pac kage package to unuse unusing package package The packages to unuse argument should be a list of pack ages or packages names or possibly a single package or package name These packages are removed from the use list of package use
83. lexicographic extension to strings of the corresponding ordering on characters String lt is the lexicographic ordering on strings induced by the order ing char lt on characters If two strings differ in length but are the same up to the length of the shorter string the shorter string is considered to be lexicographically less than the longer string string string string2 gt t or f Returns t if the two strings are the same length and con tain the same characters in the same positions otherwise returns f String treats upper and lower case as dis tinct characters See also string ci string abc string a b c gt t string ABC abc gt f string gt string string2 t or f This procedure is a lexicographic extension to strings of the corresponding ordering on characters String gt is the lexicographic ordering on strings induced by the ordering char gt on characters If two strings differ in length but are the same up to the length of the shorter string the longer string is considered to be lexicographi cally greater than the longer string string gt string string2 gt t or f 130 This procedure is a lexicographic extension to strings of the corresponding ordering on characters String gt is the lexicographic ordering on strings induced by the order ing char gt on characters If two strings differ in length but are the same up to the length of the shorter stri
84. lt in Lisp like lan guages are not transitive While it is not an error to compare inexact numbers using F Alter Reference Manual 9 Arithmetic lt the results may be unreliable because a small inaccu racy may affect the result lt numl num2 num gt t or f This procedures returns t if its arguments are monotoni cally nondecreasing lt is transitive The traditional implementations of lt in Lisp like lan guages are not transitive While it is not an error to compare inexact numbers using lt the results may be unreliable because a small inaccu racy may affect the result gt numl num2 num3 gt t or f This procedures returns t if its arguments are monotoni cally decreasing gt is transitive The traditional implementations of gt in Lisp like lan guages are not transitive While it is not an error to compare inexact numbers using gt the results may be unreliable because a small inaccu racy may affect the result gt numl num2 num3 gt t or f This procedure returns t if its arguments are monotoni cally nonincreasing gt is transitive The traditional implementations of gt in Lisp like lan guages are not transitive While it is not an error to compare inexact numbers using gt the results may be unreliable because a small inaccu racy may affect the result abs number gt number Abs returns the magnitude of its argument Abs is exact
85. minator body object or nil Detailed syntax is as follows do variablel init1 step1 test expression command Do is an iteration construct It specifies a set of variables to be bound how they are to be initialized at the start F Alter Reference Manual 23 Control eval object object and how they are to be updated on each iteration When a termination condition is met the loop exits with a spec ified result value Do expressions are evaluated as follows The init expressions are evaluated in some unspecified order the variables are bound to fresh locations the results of the init expressions are stored in the bindings of the variables and then the iteration phase begins Each iteration begins by evaluating test if the result is false then the command expressions are evaluated in order for effect the step expressions are evaluated in some unspecified order the variables are bound to fresh locations the results of the steps are stored in the bind ings of the variables and the next iteration begins If test evaluates to a true value then the expressions are evaluated from left to right and the value of the last expression is returned as the value of the do expression If no expressions are present then the value of the do expression is unspecified The region of the binding of a variable consists of the entire do expression except for the inits It is an error for a variable to a
86. n specific For Macintosh installations current directory is the same as dome home dates filename dictionary Returns a dictionary with the file s access dates delete filename type filename Deletes the file represented by the given filename dome home filename Returns a filename instance that represents the directory containing DoME s library and support files The behav ior of this procedure is host and installation specific On Unix and Windows NT systems the pathname comes from the environment variable DoMEHOME if it is not set then the start up directory is used On DOS machines the start up directory is used On Macintosh systems Alter uses the pathname of the directory containing the DoME application exists filename type gt t or f Returns t if the specified file exists otherwise returns f exists filename type gt t or f Returns t if the specified file exists otherwise returns f head filename type gt string Returns a string representing the given filename with the F Alter Reference Manual 53 File last component removed If the filename represents a file the directory path is returned If the filename represents a directory the parent directory path is returned load path filename Returns the current path used by dome to resolve filena mes This path is the concatenation of any user specified path the value of dome load path with the default load pa
87. ncies are removed Example Remove the interest expressed earlier see add interest remove interest self description self See also add interest Model Generating document generator named grapething string generator Return the first document generators applicable to the receiver object whose name matches the string argument See also document generators document generators grapething gt list Return the document generators applicable to the receiver object GrapEThing See also document generator named generate domegeneratorspec subject settings gt unspecified Run the named document generator on the subject object passed and given settings contained in the settings object Below is an simple example which outlines how this might be used define test generate lambda obj let generator nil settings nil set generator car document generators obj set settings new settings generator set property outputType settings window set property outputFormat settings Text generate generator obj settings See also document generators and new settings new settings domegeneratorspec settings object Create and return a new settings object the properties of which determine how and where a generator will operate Common properties of the settings object include filename outputFormat Text MIF outputType window file directory See also
88. nding gt unspecified Set the graphmodel s current modelbinding to the speci fied modelbinding set c unent configuration graphmodel string gt unspecified Set the configuration string that the graphmodel has active set desc ription grapething string unspecified Set the description of the object set destination netarc node gt unspecified Set the destination of the netarc set direction graphboundary symbol gt unspecified Set the direction of the graphboundary set frozen color graphobject boolean unspecified Set the frozen color property of the graphobject The fro zen color property prevents the color of the graphobject from changing through indirect means set masten grapething grapething gt unspecified The specified grapething should serve as the master of the grapething set name namednode string gt unspecified set name graphmodel string gt unspecified set name graphobjectattribute string gt unspecified set name nameddirarc string gt unspecified Set the name of the object set origin netarc node gt unspecified Set the origin of the netarc set parent connection graphobject parent child object Set the parent connection of the node or arc to the corre 82 Model Accessing sponding object in the parent diagram set position domenode point gt point Sets the absolution position of the node to be the point if possible Units are in pixel
89. ng the longer string is considered to be lexicographically greater than the longer string Iypes all ivars type list Returns a list of symbols that represent the instance vari ables for the argument and all of its supertypes Equiva lent to appending the results of calling ivars on the result of cons type all supertypes type all subtypes type list Returns a list containing the argument each of the argu ment s immediate subtypes and the elements contained in the result of applying all subtypes to each of the argu ment s immediate subtypes with duplicates removed all supertypes type list Returns a list containing each of the argument s immedi ate supertypes and the elements contained in the result of applying all supertypes to each of the argument s imme diate supertypes with duplicates removed get type object type Returns the type of the argument get type object type gt type get type make object type gt object type get type make type object type type initialize type gt type initialize object object Performs any necessary initialization on the object and returns the initialized object Initialize is called automati cally by the operation make ivars type list Returns a list of symbols that represent the instance vari ables for the argument subtypes type list Returns a list containing the argument and each of its immediate subtypes
90. ns t if the given object is either an input port or an output port Otherwise returns f See open input file open output file and terminal procedure object gt t or f Returns t if sexpr is a procedure otherwise returns f procedure car gt t procedure car gt f procedure lambda x x x gt t procedure lambda x x x gt f call with current continuation procedure gt t string object gt t or f Returns t if sexpr is a string otherwise returns f subtype object type gt t or f Returns t if object is type or a subtype of type In Alter types are subtypes of themselves subtype type type gt t subtype object type type gt f subtype type object type gt t subtype operation object type gt t symbol object t or f Returns t if sexpr is a symbol otherwise returns f symbol foo gt t symbol car a b gt t symbol bar gt f symbol nil gt t symbol gt symbol f gt f thunk object gt t or f Returns t if the object is a procedure or operation other wise it returns f thunk car gt t thunk length gt t procedure length gt f operation length gt t type object t or f Returns true if the argument is a type type type gt t F Alter Reference Manual 121 Testing type object type gt t type make object type f type type
91. nteger gt char then lt char gt integer a char gt integer b gt t char downcase char character This procedure return a character c such that char ci char c is true In addition if char is alphabetic then the result of char downcase is lower case See also char upcase char upcase char character This procedure returns a character c such that char ci char c is true In addition if char is alphabetic then the result of char upcase is upper case See also char down case exact gt inexact number float Exact gt inexact returns an inexact representation of arg The value returned is the inexact number that is numeri cally closest to the argument For exact arguments which have no reasonably close inex act equivalent Alter may signal an error This procedure implements the natural one to one corre spondence between exact and inexact integers throughout an implementation dependent range filename gt string filename type string Converts the argument filename into an Alter string See also string gt filename inexact gt exact number gt integer Inexact gt exact returns an exact representation of arg The value returned is the exact number that is numerically closest to the argument For inexact arguments which have no reasonably close exact equivalent Alter may signal an error F Alter Reference Manual 27 Converting This procedure implements the natural one to one corre
92. o The result for inexact numbers may be unreliable because of small inaccuracies Testing Strings string ci lt string string2 gt t or f This procedure is a lexicographic extension to strings of the corresponding ordering on characters String ci lt is the lexicographic ordering on strings induced by the ordering char ci lt on characters If two strings differ in length but are the same up to the length of the shorter string the shorter string is considered to be lexicographi cally less than the longer string string ci lt string string2 t or Hf This procedure is a lexicographic extension to strings of the corresponding ordering on characters String ci lt is the lexicographic ordering on strings induced by the ordering char ci lt on characters If two strings differ in length but are the same up to the length of the shorter string the shorter string is considered to be lexicographi cally less than the longer string string ci string string2 gt t or f Returns t if the two strings are the same length and con tain the same characters in the same positions otherwise returns f String ci treats upper and lower case letters as though they were the same character See string string ci abc string Ha b c gt t string ci ABC abc gt t string ci ab AbC gt tf string ci gt string string2 t or f This procedure is a lexicographic extension to
93. o include literal constants in Alter code F Alter Reference Manual 39 Defining quote a gt a quote a b c gt a b c quote 12 gt 12 quote object may be abbreviated as object The two notations are equivalent in all respects 4 a gt a a bc gt a b c 0 gt 12 gt 12 quote a gt quote a a quote a Numerical constants string constants character con stants and boolean constants evaluate to themselves they need not be quoted abc gt abc abc gt abc 145932 gt 145932 145932 gt 145932 Ht gt t t gt t It is an error to alter a constant i e the value of a literal expression using a mutation procedure like set car or string set set variable expression gt object Expression is evaluated and the resulting value is stored in the location to which variable is bound Variable must be bound either in some region enclosing the set expres sion or at top level The result of the set expression is unspecified define x 2 x 1 gt 3 set x 4 gt unspecified x 1 gt 5 unquote expression object See quasiquote unquote splicing expression object 40 See quasiquote Dictionaries dictionary gt list dictionary list Creates a list that is a projection of the given dictionary The list is of the form k1 v1 k2 v2 where each k is a key from the dictionary and
94. odule gt boolean Each module has a unique name a string The provide and require functions accept either a string or a symbol as the module name argument If a symbol is provided its print name is used as the module name The provide procedure adds a new module name to the list of modules thereby indicating that the module in question has been loaded require module gt boolean Each module has a unique name a string The provide and require functions accept either a string or a symbol as the module name argument If a symbol is provided its print name is used as the module name The require function tests whether a module is already present if the module is not present require proceeds to load the appropriate file or set of files The pathname argument if present is a single filename that is to be loaded If the pathname argument is not provided the system will attempt to determine which files to load by searching along the DoME load path as follows first it will look for a file named module name next it will look for a file named module name alt last it will look for a file named module name lib Alter also records the modified timestamp of a module s file when it loads it If the module has already been loaded Alter will check the current timestamp of the file If it is later than the stored timestamp then Alter will re load the module F Alter Reference Manual 95 Modules 96 OS Interfa
95. of views at the next level only of the given grapething instance The elements of the returned list will be of the same type as the argument supplied to the views operation If there are no views an empty list will be returned See also master The following express will always be true memq self views master self where self is some graphobject instance and not nil master self what are you grapething string Given a grapething instance the what are you operation returns a string describing the instance e g a user sensi ble rendering of its class name This is mainly useful for interacting with the user 84 Model Creation merge file graphmodel file gt nil Merge the model contained in the file String or Filename into the graphmodel new c hild model protodomespecwrapper graph object graphmodel new child model graphmodel class graph object gt graphmodel new child model metadomegraph graphobject graphmodel Creates a new instance of the given graphmodel class asa child of the specified graphobject node or arc New child model does NOT open an editor window on the resulting instance The edit operation will do this See also new top model new in nodes and arcs new in metadomearcspec graph originnode destinationnode route arc new in domenode class graph position node new in metadomenodespec graph position node new in netarc class graph originnode de
96. on of Scheme sitting within DoME We say nearly because there are a few things that we have omitted from the R definition most notably proper tail recursion and continuations Future versions of Alter may remove these limitaions Alter differs from Rf Scheme in a few other ways too e Complex numbers are not yet implemented e Several primitives have been added to support the manipulation of graph structures built with DoME e Alter operates in a windowed graphics capable environment and has some extra primitives to support this e Alter code can be used in several settings within DoME 1 Clinger W and Rees J eds Revised Report on the Algorithmic Language Scheme F Alter Reference Manual 1 Introduction including printing displaying animation constraint checking model analysis and interprocess communication This last point is very important Alter is much more than a medium for writing code generators or document generators Itis a general purpose programming language that can be used within DoME in a variety of ways One key to making better use of Alter is understanding DoME s architecture especially the object structures used to represent graphs and their annotations This information can be found in the GrapE Programmer s Reference Manual There are several ways to invoke Alter operations and procedures These are all described in detail in the DoME Extension Manual
97. ontain the given arguments Analogous to list vector a b c gt ab c vector fill vector obj vector Stores arg2 in every element of arg1 The value returned by vector fill is unspecified vector length vector integer Returns the number of elements in vector vector length 1 2 3 gt 3 vector ref vector k object Vector ref returns the kth element of vector vector ref 1123581321 5 gt 8 vector ref 1 12358 13 21 inexact gt exact round 2 acos 1 gt 13 vector set vector k obj object Vector set stores obj in element k of vector The value returned by vector set is unspecified let vec vector 0 2 2 2 2 Anna vector set vec 1 Sue Sue vec gt 0 Sue Sue Anna vector set 0 1 2 1 doe error constant vector F Alter Reference Manual 135 Vectors 136 LESS AA x No 127 10 10 super 26 E yi A abs 10 accessories 75 acos 71 add binding named 75 add child 75 add interest 87 add method 33 all ivars 131 all packages 99 all subtypes 131 all supertypes 131 and 69 any changes 91 append 15 apply 19 archetype 75 archetype 75 archetype shelf 75 archetypifiable 75 arcs 75 as backup 53 asin 71 assoc 51 assq 51 assv 51 atan 71 background color 105 baseline 76 begin 19 F Alter Reference Manual A binding named 76 bindings 33 blue 17 bold 55 boolean 115
98. ort read through char char port string resetport nil Return a string from the current position of the port to the first occurrence of char inclusive If char is not encoun tered then return the entire string from port Reset the position to the beginning with input from file string proc object 62 The file is opened for input an input port connected to it is made the default value returned by current input port and the thunk procedure or operation is called with no arguments When the thunk returns the port is closed and the previous default is restored With input from file 1 0 returns the value yielded by thunk If an escape procedure is used to escape from the continu ation of this procedure the port is closed with output to file string proc object The file is opened for output an output port connected to it is made the default value returned by current output port and the thunk procedure or operation is called with no arguments When the thunk returns the port is closed and the previous default is restored With output to file returns the value yielded by thunk If an escape procedure is used to escape from the continu ation of these procedures the port is closed write object port nil Writes a written representation of sexpr to the given port Strings that appear in the written representation are enclosed in doublequotes and within those strings back slash and do
99. ort default output port F Alter Reference Manual 73 Miscellaneous and execution stack of the current environment to their default values return spec proc gt string Returns a string representing the type of object typically returned by the given procedure sleep milliseconds gt nil Causes the DoME process to go inactive for the specified number of milliseconds This is useful for animation and other related purposes time now gt vector Returns a list containing a representation of the current system time The list is interpreted as follows hours minutes seconds 74 Model Accessing accessories graphobject list Answer a list of nodes that are accessories of the node Accessories are nodes that are usually attached to the boundary of the node add binding named graphobject configuration graphmodel gt modelbinding add binding named graphmodel configuration graphobject modelbinding For a graphobject add a binding with the given name from the graphobject to the specified graphmodel For a graphmodel add a binding with the given name from the specified graphobject to the graphmodel add child graphobject graphmodel graphmodel Checks to see if aGraphModel is a subdiagram of aGraph Object Ifitis NOT a subdiagram it adds aGraphModel to aGraphObject s subdiagrams and returns aGraphModel Otherwise returns nil archetype graphobject graphobject archetype domenode gt nod
100. ose name is arg This procedure can create symbols with names containing special charac ters or letters in the non standard case but it is usually a bad idea to create such symbols because in some imple mentations of Scheme they cannot be read as themselves See symbol gt string The following examples assume that the implementa tion s standard case is lower case eq mISSISSIppi mississippi t string gt symbol mISSISSIppi gt the symbol with name mISSISSIppi eq bitBlt string gt symbol bitBlt gt f eq Jolly Wog string gt symbol symbol gt string JollyWog gt t string K Harper M D symbol gt string string gt symbol K Harper M D gt t string capitalize string string This procedure returns a string of equal length to the argument string such that the first character of the string is now uppercase char ci is true string downcase string gt string This procedure returns a string of equal length to the argument string such that char ci is true for each corre sponding character of the argument and the result In addition if a given character in the argument string is alphabetic the corresponding character in the result string is lower case See also string upcase string upcase string gt string This procedure returns a string of equal length to the argument string such that char ci is true for each corre sponding character of the argument and
101. p 2 paintstyle gc P paint coloralter graphics context colorvalue Given a graphics context instance the paint color opera tion returns a colorvalue instance representing the current pen color for drawing objects This operation is useful primarily in user defined DoME printer drivers See appendix See red green blue hue saturation bright F Alter Reference Manual 105 Printer Driver ness cyan magenta and yellow operations for extracting color components from a colorvalue instance paint style alter graphics context gt symbol Given a graphicscontext instance returns a symbol repre senting the current pen drawing style solid or gray This operation is useful primarily for writing user defined DoME printer drivers see appendix See also paintcolor paint 106 NAAN aa TA hb 4 Rectangles centerrectangle point Returns the point that lines at the center of the supplied rectangle See rectangle for a specification of how rect angles are represented center 3 8 5 12 gt 4 10 center 3 8 5 12 gt 4 10 expand rectangle rectangle expansion rectangle Returns a new rectangle which represents the given rect angle expanded by the specified expansion The expan sion may be specified as a number a point or a rectangle If it is a number all sides of the rectangle are moved out ward by the specified amount If it is a point then the left and ri
102. ppear more than once in the list of do vari ables A step may be omitted in which case the effect is the same as if variable init variable had been written instead of variable init do vec make vector 5 0 i1 15 vec vector set vec i i gt 0 1 2 3 4 let x 1 3 5 7 9 do x x cdr x sum 0 sum car x null x sum gt 25 Evaluates the expression a second time and returns the result of that evaluation eval 5 gt 5 eval eq gt a procedure eval list 2 7 gt 9 for each proc list1 list2 gt nil 24 The arguments to for each are like the arguments to map Control but for each calls proc for its side effects rather than for its values Unlike map for each is guaranteed to call proc on the elements of the lists in order from the first element to the last and the value returned by for each is unspeci fied let v make vector 5 for each lambda i vector set v i ii 01234 v gt 0149 16 if test consequence alternate object or nil Test consequent and alternate may be arbitrary expres sions An if expression is evaluated as follows first test is eval uated If it yields a true value any value which is not f then consequent is evaluated and its value is returned Otherwise alternate is evaluated and its value is returned If test yields a false value and no alternate is specified then the result of the expre
103. procedure with the power of call with cur rent continuation call with current continuation lambda exit for each lambda x if negative x exit x 54 0 37 3 245 19 t gt 3 define list length lambda obj call with current continuation lambda return letrec r lambda obj cond null obj 0 pair obj r cdr obj 1 else return f r obj list length 1 2 3 4 gt 4 list length a b c gt f A common use of call with current continuation is for structured non local exits from loops or procedure bod ies but in fact call with current continuation is extremely useful for implementing a wide variety of advanced control structures Whenever a Scheme expression is evaluated there is a continuation wanting the result of the expression The continuation represents an entire default future for the computation If the expression is evaluated at top level for example then the continuation might take the result print it on the screen prompt for the next input evaluate it and so on forever Most of the time the continuation includes actions specified by user code as in a continua tion that will take the result multiply it by the value stored in a local variable add seven and give the answer to the top level continuation to be printed Normally these ubiquitous continuations are hidden behind the scenes and programmers don t think much about them On rare occasions
104. r lower case char lt argl arg2 t or f Returns t if the character represented by the first argu ment is the same as or precedes the character represented by the second argument assuming a total ordering on the set of characters char lt arg1 arg2 t or f Returns t if the character represented by the first argu ment precedes the character represented by the second argument assuming a total ordering on the set of charac ters char arg1 arg2 t or f Returns t if the two arguments represent the same char acter char gt arg1 arg2 t or f Returns t if the character represented by the first argu ment is the same as or follows the character represented by the second argument assuming a total ordering on the set of characters char gt arg1 arg2 t or f Returns t if the character represented by the first argu ment follows the character represented by the second argument assuming a total ordering on the set of charac ters eof object object gt t or f Returns t if arg is an end of file object otherwise returns f The precise set of end of file objects will vary among implementations but in any case no end of file object will ever be an object that can be read in using read 124 Testing Geometric Objects 69 point object boolean Answers t if the argument is a point f otherwise A point is either a two element vector of the form x y or a pair of the
105. re evaluated sequentially from left to right and the value of the last expression is returned This expression type is used to sequence side effects such as input and output define x 0 begin set x 5 Fx gt 6 begin display 4 plus 1 equals display 4 1 gt unspecified and prints 4 plus 1 equals 5 call with current continuation proc gt value Proc must be a procedure of one argument The proce dure call with current continuation packages up the cur rent continuation see the rationale below as an escape procedure and passes it as an argument to proc The escape procedure is a Scheme procedure of one argument that if it is later passed a value will ignore whatever con tinuation is in effect at that later time and will give the value instead to the continuation that was in effect when the escape procedure was created In standard Scheme the escape procedure that is passed to proc has unlimited extent just like any other procedure in Scheme But this is not the case in Alter where the escape procedure s extent is limited to the duration of the activation of the call with current continuation that defined it The escape procedure may be stored in vari ables or data structures The following examples show only the most common uses of call with current continuation If all real pro grams were as simple as these examples there would be F Alter Reference Manual 19 Control no need for a
106. res Whenever a Scheme expression is evaluated there is a continuation wanting the result of the expression The continuation represents an entire default future for the computation If the expression is evaluated at top level for example then the continuation might take the result print it on the screen prompt for the next input evaluate it and so on forever Most of the time the continuation includes actions specified by user code as in a continua tion that will take the result multiply it by the value stored in a local variable add seven and give the answer to the top level continuation to be printed Normally these ubiquitous continuations are hidden behind the scenes and programmers don t think much about them On rare occasions however a programmer may need to deal with continuations explicitly Call with current con tinuation allows Scheme programmers to do that by cre ating a procedure that acts just like the current continuation Most programming languages incorporate one or more special purpose escape constructs with names like exit return or even goto In 1965 however Peter Landin invented a general purpose escape operator called the J Control operator John Reynolds described a simpler but equally powerful construct in 1972 The catch special form described by Sussman and Steele in the 1975 report on Scheme is exactly the same as Reynolds s construct though its name came from a less g
107. rned Port may be omitted in which case it defaults to the value returned by current input port The value returned by a call to peek char is the same as the value that would have been returned by a call to read char with the same port The only difference is that the very next call to read char or peek char on that port will return the value returned by the preceding call to peek char In particular a call to peek char on an interactive port will hang waiting for input whenever a call to read char would have hung read port expression Read converts external representations of Scheme objects into the objects themselves That is it is a parser for the nonterminal datum Read returns the next object pars able from the given input arg updating arg to point to the first character past the end of the external representation of the object If an end of file is encountered in the input before any characters are found that can begin an object then an end of file object is returned The port argument may be omitted in which case it defaults to the value returned by current input port Itis an error to read from a closed port read char port character Returns the next character available from the input port updating the port to point to the following character If no more characters are available an end of file object is returned Port may be omitted in which case it defaults to the value returned by current input p
108. s and the point is a pair of the form x y This operation can also be applied to arc name tags and other accessories Itis an error to apply this operation to instances of GraphObjectAttribute since their positions are determined completely automatically and are strictly relative to their containers See also rela tive position set and synchronize display set property object propname value gt nil set property propname object value gt nil Sets the value of the propnamestring property on the gra pething object to the specified value Set property may work on non GrapEThing objects but its behavior is unspecified in those cases Itis an error if the property name is not valid for the given class of object The DoME Tool Specifications define the properties on the various DoME objects The property name which IS case sensi tive can either by a string or a symbol set property schema files grapething list gt unspecified Set the property schema files property to the specified list of filenames set rationale grapething string unspecified Set the rationale of the object set relative position domenode point gt point Sets the relative position of the node to be the point if possible Units are in pixels and the point is a pair of the form x y The position given is relative to the node s container possibly the graph whose position is consid ered to be 0 0 Some subclasses of DoMENode may generate an
109. sequence of one or more expres sions It is an error for a variable to appear more than once in the list of variables being bound The variables are bound to fresh locations holding unde fined values the inits are evaluated in the resulting envi ronment in some unspecified order each variable is assigned to the result of the corresponding init the body is evaluated in the resulting environment and the value F Alter Reference Manual 37 Defining of the last expression in body is returned Each binding of a variable has the entire letrec expression as its region making it possible to define mutually recursive proce dures letrec even lambda n if zero n t odd n 1 odd lambda n if zero n f even n 1 even 88 gt t One restriction on letrec is very important it must be pos sible to evaluate each init without assigning or referring to the value of any variable If this restriction is violated then itis an error The restriction is necessary because Scheme passes arguments by value rather than by name In the most common uses of letrec all the inits are lambda expressions and the restriction is satisfied automatically make type ivars supertypes type make type object Creates an instance of the specified type Make is most useful for creating instances of type Operation but can also be used for creating instances of GrapEThing and its subclasses e g
110. splayed during its execution The meter displays the message supplied as a string as the first argument and a partially filled circle The circle shows the percentage of top level list elements that have been processed by the given procedure Note that this at best only approximates the actual proportions involved since show progress for each has no clues about how long it will take to process each set of elements Asuper type operation object gt object 26 This is just like operation object args except that the method search begins at type rather that the type of object Itis required that type be an immediate supertype of the type that the method this call appears in is added to although the current implementation does not yet enforce this restriction super is analogous to the Small talk 80 mechanism of the same name except that due to Alter s multiple inheritance it is necessary for the pro grammer to explicitly state which supertype is to be dis patched to ge ZAZ Ni li l KAGN Converting AN char gt integer char gt integer Given a character char gt integer returns an exact integer representation of the character This procedure imple ments an injective order isomorphism between the set of characters under the char lt ordering and some subset of the integers under the lt ordering That is if char lt ab gt t and lt x y gt t and x and y are in the domain of i
111. ssion is unspecified if gt 3 2 yes no gt yes if gt 2 3 yes no gt no if gt 3 2 3 2 32 gt 1 in new environment do body gt nil Creates a new parent less environment in which to eval uate the supplied body expressions map proc list1 list2 5 list Map applies proc element wise to the elements of the lists and returns a list of the results in order from left to right The dynamic order in which proc is applied to the elements of the lists is unspecified map cadr a b de g h gt b e h map lambda n expt n n 12345 gt 1427 256 3125 map 12 3 45 6 gt 579 let count 0 map lambda ignored set count count 1 count F Alter Reference Manual 25 Control ab c unspecified show progress begin label body object or nil Show progress begin is just like begin except that a progress meter is displayed during its execution The meter displays the message supplied as a string as the first argument and a partially filled circle The circle shows the percentage of expressions that have been eval uated Note that this at best only approximates the actual proportions involved since show progress begin has no clues about how long it will take to evaluate each expression show progress for each message proc list1 list2 gt nil Show progress for each is just like for each except that a progress meter is di
112. stinationnode route arc New in is an operation defined on node classes and arc classes and is used for creating new instances of nodes and arcs Both methods require the second argument to be a graphmodel instance that is to contain the new object The node class method accepts a third optional argu ment that specifies the pixel coordinates for the new node if it is omitted GrapE will use a default position that depends on the type of node The position coordinate must be supplied as a pair whose car is the x coordinate and whose cdr is the y coordinate y 0 is the top of the window Units are pixels The third and fourth arguments to the arc class method must be node instances The third argument specifies the node that will serve as the new arc s origin the fourth argument specifies the node that will serve as the new arc s destination Itis legal for the origin and destination to be the same object The fifth optional argument must be a list of points pairs that serve as the intermediate route bend points for the arc proceeding from the origin side to the destination side If no route it supplied the arc will be a straight line automatically clipped to the bound aries of the origin and destination node The form of each point is a pair whose car is the x coordinate and whose cdr is the y coordinate Units are pixels and y 0 is the top of the editing area F Alter Reference Manual 85 Model Creation define
113. string such that all occurrences of substring are replaced with the replacement string Returns a copy of the string with all white space removed from its end White space characters include space car lt riage return tab line feed null and form feed word wrap string width ignorecrs list of string 16 Word wrap converts a string into a list of strings each being at most n characters long where n is the first optional argument 75 by default If a second boolean argument is given and is true then carriage returns are converted to spaces before the string is word wrapped If the second optional argument missing or false a carriage return is represented as a zero length string in the result Regardless of the optional arguments the trailing white space is ignored and not represented in the result ing list Colors blue color type gt number Returns a number between 0 and 1 representing the blue component of the given color value see also red green brightness color type number Returns a number between 0 and 1 representing the brightness level of the given color value see also hue sat uration Color values are usually obtained via a Graphic sContext instance used when printing graphs through user supplied print drivers cyan color type number Returns a number between 0 and 1 representing the cyan component of the given color value see also magenta yellow Color values are usuall
114. t gt grapething Attempts to resolve the reference to the remote DoME object If successful the operation answers the remote object If unsuccessful DoME raises an error dialog and the operation returns nil During the attempt to resolve the identity DoME may cause the file containing the object to be loaded into memory route netarc gt list Returns a list of points of the form x y that represent where the given arc bends The endpoints where the arc attaches to the origin and destination nodes are not included in the list therefore it may be the case that route returns an empty list Units are pixels selected components grapething list Answer a list of graphobjects that are currently selected in the graphmodel set border bounds domenode rectangle gt rectangle Sets the rectangular border bounds of the given node to F Alter Reference Manual 81 Model Accessing be the specified rectangle See rectangle for a specifica tion of the representation of a rectangle set color graphobject color unspecified set color font description color value nil Sets the color of the receiver to the color value argument set configurations graphmodel list unspecified Set the configurations that are available to be used throughout the model set containen grapething new container gt t or f Make grapething a component of new container See components set cunent binding graphmodel modelbi
115. t or f Returns t if both the x and y coordinates of the first point are greater than the x and y coordinates of the second point see point Otherwise returns f point gt 3 2 2 2 gt f point gt 3 2 2 1 gt t point gt pt1 pt2 pt3 gt t or f Returns t if both the x and y coordinates of the first point are greater than or equal to the x and y coordinates of the second point see point Otherwise returns f point gt 3 2 2 2 gt t point gt 3 2 2 3 gt radius point number Answer the polar coordinate system radius of the given point theta point gt number Returns the angular component in radians of the ray represented by the given point see point theta 2 0 gt 0 0 theta 5 5 gt 0 785398 102 x point number y point number Points theta 1 3 gt 1 89255 theta 2 2 gt 5 49779 Returns the x coordinate of a point see point x 3 9 gt 3 x 2 57 gt 25 Returns the y coordinate of a point see point y 8 9 gt 9 y 2 57 gt 7 F Alter Reference Manual 103 Points 104 SOS NAZNI AL Printer Driver background coloralter graphics context colorvalue may Given a graphics context instance the background color operation returns a color value object that represent the current background color used by the context landscape alt
116. t size to determine the total number of spaces to use when indent ing indent size document context gt nil Returns the value of the receiver s indent size The indent size is multiplied by the receiver s indent level to determine the total number of spaces to use when indent ing left margin document context gt inches Returns the size of the left margin in inches for a page generated by the receiver F Alter Reference Manual 45 Document Generation next multilevel tag document context level separator key string Bumps the multilevel counter at the indicated level and returns a string consisting of the current state of each level separated by the specified separator string If sepa rator is not specified a period is used If the optional key is present then the multilevel counter associated with that key is affected para is the default key See also reset multilevel counter and supports native para graph numbering next putdocument context string gt nil Adds the string argument to the receiver s output stream open ps context output gt nil open document context output D nil Sets the receiver s port to an output port If the optional output argument is not provided then a window is open and the port is set to the window If the optional output argument is passed it must be a string filename or out put port If it is a string the string is converted to a file name the
117. tallations if the HOME environment variable is set that is used to form the filename otherwise C is used for Windows and is used for Unix 54 A 00 Now area Font Descriptions bold font description boolean Returns a boolean indicating whether the font is bold or not default font description font description Returns the system s default font description family font description gt string Returns a string or a vector representing the font s family If a vector is returned it is a vector of strings representing alternative names for the font family fixed width font description gt boolean Returns a boolean that indicates whether all characters in the font can be expected to be the same width italic font description boolean Returns a boolean indicating whether the font is italic or not serif font description boolean Returns a boolean indicating whether the font is serif or not set bold font description boolean nil Sets the value of the font s bold property to the boolean argument set family font description string gt nil Sets the receiver s family to the string argument set fixed width font description boolean nil Sets the value of the font s fixed width property to the boolean argument The font s set width property indi cates whether all characters in the font can be expected to be the same width set italic font description boolean
118. th make directory filename type filename Causes the host to create the directory represented by file name The behavior of this function is host specific Everything but the last component of filename must already exist before make directory is called it is an error otherwise move to filename destination gt nil Renames filename to destination another filename Destination may be a completely different pathname but the behavior of move to is host specific if filename and destination are on different devices It is an error if desti nation cannot be opened for writing or filename cannot be opened for reading resolve filename filename Returns the full path of a file if it exists along the dome load path otherwise returns the filename unaltered tail filename type string Returns a string representing the given filename with all but the last component removed temporary filename gt filename Returns a filename that can be opened for writing to save temporary data such as a file to print The composition of the filename may be host specific user home gt filename Returns a filename instance that represents the home directory of the user The behavior of this procedure is host and installation specific Note Macintosh and Win dows hosts do not ordinarily support the concept of user home directories For Macintosh installations user home is the same as dome home In Windows and Unix ins
119. the identifier and its associated object from the registry F Alter Reference Manual 109 Registry 110 Kpc open client sockethostname port gt input output port Open a connection to the given host on the given port F Alter Reference Manual 111 Rpc 112 Strings make string length char string Make string returns a newly allocated string of the speci fied length If char is given then all elements of the string are initialized to char otherwise the contents of the string are unspecified string char rest gt string Returns a newly allocated string composed of the argu ments string append stringl string2 string Returns a newly allocated string whose characters form the concatenation of the given strings string append a bc de gt abcde string copy string gt string Returns a newly allocated copy of the given string string fill string char gt string Stores arg2 in every element of the given argl and returns an unspecified value See also make string string length string integer Returns the number of characters in the given string See also length string ref string index character String ref returns the indexth character of string using zero origin indexing string set string index char gt string String set stores char in the indexth position of string and returns an unspecified value String set uses zero origin in
120. the result In addition if a given character in the argument string is alphabetic the corresponding character in the result string is upper case See also string downcase symbol gt string symbol string 30 Returns the name of symbol as a string If the symbol was part of an object returned as the value of a literal Converting expression or by a call to the read procedure and its name contains alphabetic characters then the string returned will contain characters in the implementation s preferred standard case some implementations will pre fer upper case others lower case If the symbol was returned by string gt symbol the case of characters in the string returned will be the same as the case in the string that was passed to string gt symbol It is an error to apply mutation procedures like string set to strings returned by this procedure The following examples assume that the implementa tion s standard case is lower case symbol gt string flying fish flying fish symbol gt string Martin martin symbol gt string string gt symbol Malvina gt Malvina type gt symbol type symbol Converts a type e g grapething color type procedure type into asymbol This is useful for dealing with GrapE objects vector gt list vector list Vector gt list returns a newly allocated list of the objects contained in the elements of arg See also list gt vector vector gt list dah dah
121. third argument is a list of objects one for each list item One of these objects will be returned indicating which item was selected The fourth argument is an object that must match one of the objects in the list given in the third argument and specifies which list item will be the default the one initially selected when the dialog opens The fifth argument is an object that is returned if the cancel button is pressed The sixth optional argument is an integer value specifying the number of lines in the list to show at once The sev enth optional argument is another list of strings which serves as the labels for a set of additional buttons The eighth optional argument must be included if the sev enth argument is included This argument is a list objects one for each string in the seventh argument that are returned when one of the additional buttons are pressed warn message text gt nil 134 Pops up a modal dialog window with the given mes sage and a single button labeled OK that the user must press or equivalently hit the Return key in order to con tinue with further DoME activity Vectors make vector size fillval vector Returns a newly allocated vector of size elements Ifa second argument is given then each element is initialized to fillval Otherwise the initial contents of each element is unspecified vector items vector Returns a newly allocated vector whose elements c
122. tinuation is in effect at that later time and will give the value instead to the continuation that was in effect when the escape procedure was created In standard Scheme the escape procedure that is passed to proc has unlimited extent just like any other procedure in Scheme But this is not the case in Alter where the escape procedure s extent is limited to the duration of the activation of the call with current continuation that defined it The escape procedure may be stored in vari ables or data structures The following examples show only the most common uses of call with current continuation If all real pro grams were as simple as these examples there would be no need for a procedure with the power of call with cur rent continuation call with current continuation lambda exit for each lambda x if negative x F Alter Reference Manual 21 Control 22 exit x 54 0 37 3 245 19 t gt 3 define list length lambda obj call with current continuation lambda return letrec r lambda obj cond null obj 0 pair obj r cdr obj 1 else return f r obj list length 1 2 3 4 gt 4 list length a b c gt f A common use of call with current continuation is for structured non local exits from loops or procedure bod ies but in fact call with current continuation is extremely useful for implementing a wide variety of advanced control structu
123. tored in those locations and the expressions in the body of the lambda expression F Alter Reference Manual 35 Defining will be evaluated sequentially in the extended environ ment The result of the last expression in the body will be returned as the result of the procedure call lambda x x x gt a procedure lambda x x x 4 gt 8 define reverse subtract lambda x y y x reverse subtract 7 10 gt 3 define add4 let x 4 lambda y x y add4 6 gt 10 Formals should have one of the following forms variable The procedure takes a fixed number of arguments when the procedure is called the arguments will be stored in the bindings of the corresponding variables variable The procedure takes any number of arguments when the procedure is called the sequence of actual arguments is converted into a newly allocated list and the list is stored in the binding of the variable variablel variablen 1 variablen If a space delimited period precedes the last variable then the value stored in the binding of the last variable will be a newly allocated list of the actual arguments left over after all the other actual arguments have been matched up against the other formal arguments It is an error for a variable to appear more than once in formals lambda x x 3 45 6 gt 3 4 5 6 lambda x y z z 3456 gt 56 Each procedure created as the result of evaluat
124. tween constants where appropriate Thus the value of eqv on constants is sometimes implementation dependent eqv a a gt unspecified eqv a a gt unspecified eqv b cdr a b gt unspecified let x a equ x x gt t The above definition of eqv allows implementations lati tude in their treatment of procedures and literals imple mentations are free either to detect or to fail to detect that two procedures or two literals are equivalent to each other and can decide whether or not to merge representa tions of equivalent objects by using the same pointer or bit pattern to represent both grape object gt t or f Returns true if the given object is an instance of grapeth ing or one of its many subclasses Returns false otherwise input port object gt t or f Returns t if the given port is an input port otherwise returns f See open input file is a object type gt t or f Returns t if object is an instance of type or one of its sub types is a object object type is always true is a object type type gt t is a type object type gt t is a operation type gt t is a is a procedure type gt t is a is a type f is a make object type type f F Alter Reference Manual 119 Testing list object gt t or f Returns t if sexpr is a list otherwise returns f By defini tion all lists have finite length and are terminat
125. ty lists returned by list tail list k for k less than the length of list If obj does not occur in list then f not the empty list is returned Memv uses eqv to compare obj with the ele ments of list See also memq member memv 101 100 101 102 gt 101 102 select list predicate list Select returns a new list containing references to the top level members of the given list that cause the specified one argument procedure to answer a true value a true value in Alter is any value that is not eq with f select alpha beta gamma lambda s string lt s c alpha beta 52 File as backup filename type gt string Returns a string that is derived from the given filename and can be used as a backup for that filename The behavior of this operation is host specific constuctfilename rest filename Returns a new filename instance whose head is the given filename and whose tail consists of the given string The precise behavior of this operation is host specific copy to filename destination gt nil Copies filename to destination another filename Desti nation may be a completely different pathname It is an error if destination cannot be opened for writing or file name cannot be opened for reading current directory gt filename Returns a filename instance that represents the directory in which DoME was started The behavior of this proce dure is host and installatio
126. ublequote characters are escaped by back slashes Write returns an unspecified value The port argument may be omitted in which case it defaults to the value returned by current output port write char char port nil Writes the character not an external representation of the Character to the given port and returns an unspecified value The port argument may be omitted in which case it defaults to the value returned by current output port F Alter Reference Manual 63 I O 64 Lists car list object Returns the contents of the car field of the pair Note that itis an error to take the car of the empty list car abc gt a car a b c d gt a car 1 2 gt 1 car gt error cdr list object Returns the contents of the cdr field of the pair Note that it is an error to take the cdr of the empty list cdr a b c d gt b c d cdr 1 2 2 cdr gt error cons obj1 obj2 pair Returns a newly allocated pair whose car is obj1 and whose cdr is obj2 The pair is guaranteed to be different in the sense of eqv from every existing object consa gt a cons a b c d gt a b c d cons a b c gt a b c cons a 3 gt a 3 cons a b c gt ab c list items list Returns a newly allocated list of its arguments list a 3 4 e a 7 c list gt list head list index list Returns a copy of the
127. umbers may be unreliable because of small inaccuracies rational object gt t or f real object gt t or f zero object t or f 128 Rational can be applied to any kind of argument includ ing non numbers It returns t if the object is a rational and otherwise it returns f If rational is true of a number then all higher type predi cates are also true of that number Consequently if ratio nal is false of a number then all lower type predicates are also false of that number rational 6 10 gt t rational 6 3 gt t The behavior of rational on inexact numbers is unreli able since any inaccuracy may affect the result See also number complex real and integer Real can be applied to any kind of argument including non numbers It returns t if the object isa real number and otherwise it returns f If real is true of a number then all higher type predicates are also true of that number Consequently if real is false of a number then all lower type predicates are also false of that number If z is an inexact complex number then real z is true if and only if zero imag part z is true If x is an inexact real number then integer x is true if and only if x round x real 3 gt t real 2 5 0 0i t real e1e10 gt t See also number complex rational and integer This procedure returns t if its argument is exactly equal to zer
128. undary point on a DFD graph is an arc whose destina tion is the process node being refined In some cases the parent connection may be part of an archetype position graphobject point Returns the absolute position in pixels of the given object as a point x y 80 Model Accessing property sc hema files grapething list Answer the property schema files property which is a list of filenames that represent UDP models rationale grapething string Returns the value of the rationale property of the given grapething instance The returned value is a string pos sibly empty relative position domenode gt point Returns the relative position in pixels of the given node as a point x y The returned value is relative to the object s container s position If the container is a Graph Model instance the container s position is taken to be 0 0 relative scale graphmodel number relative scale alter graphics context number Returns a value like 1 0 or 1 5 15095 etc that can scale fonts or other values remove grapething gt nil Deletes the specified grapething from its container and removes all other references to it remove child graphobject graphmodel gt graphmodel Checks to see if aGraphModel is a subdiagram of aGraph Object If it is a subdiagram it removes aGraphModel from aGraphObject s subdiagrams and returns aGraph Model Otherwise returns nil resolve identity remotegraphobjec
129. upports native paragraph numbering 49 symbol gt string 30 Index 142 symbol 121 synchronize display 94 T tail 54 tan 71 temporary filename 54 text line height 84 theta 102 thunk 121 time now 74 top margin 49 top model 84 top model 91 translate rectangle 108 translation 49 trim 16 truncate 13 type gt symbol 31 type 121 U underline 56 unexport 100 unquote 40 unquote splicing 40 unregister 109 unset property 84 unuse package 100 upper left 108 upper right 108 use package 100 user choose 133 user choose from list 134 user home 54 V vector 135 vector gt list 31 vector 122 vector fill 135 vector length 135 vector ref 135 vector set 135 views 84 visible 92 Ww warn 134 what are you 84 width 108 with input from file 62 with output to file 63 word wrap 16 writable 122 write 63 write bitmap 86 write char 63 write postamble 49 write preamble 49 F Alter Reference Manual Index x 103 Y y 103 yellow 18 Z zero 128 Index 143
130. y object object Returns a copy of the argument Most things in Alter are constants and so copy returns the argument itself Copying strings returns a string of equal length to the argument string such that char is true for each corre sponding character of the argument and the result equiv alent to string copy Copying lists returns a list of equal length to the argu ment list such that eq returns true for each correspond ing element of the argument and the result Copying vectors returns a vector of equal length to the argument vector such that eq returns true for each corre sponding element of the argument and the result F Alter Reference Manual 33 Defining Copying dictionaries returns a dictionary of equal size to the argument dictionary such that eq returns true for each corresponding key of the argument and the result and eq returns true for each corresponding value of the argument and the result Copying grapethings is dependent on how the particular subclass implements copying itself Copying instances of user defined types returns an object whose instance variables are set to a copy of the object that the argument s instance variable was set to define varspec valueorbody body object or procedure 34 Definitions are valid in some but not all contexts where expressions are allowed They are valid only at the top level of a program and in some implementations at the beginning of a body A
131. y obtained via a Graphic sContext instance used when printing graphs through user supplied print drivers green color type number Returns a number between 0 and 1 representing the green component of the given color value see also red blue Color values are usually obtained via a GraphicsContext instance used when printing graphs through user sup plied print drivers hue color type number Returns a number between 0 and 1 representing the hue component of the given color value see also brightness saturation Color values are usually obtained via a GraphicsContext instance used when printing graphs through user supplied print drivers magenta color type number Returns a number between 0 and 1 representing the magenta component of the given color value see also cyan yellow Color values are usually obtained via a GraphicsContext instance used when printing graphs through user supplied print drivers make cmy color cyan magenta yellow color Creates a color value object whose cyan value is the first argument magenta value is the second argument and yel low value is the third argument make color red green blue color Creates a color value object whose red value is the first argument green value is the second argument and blue value is the third argument F Alter Reference Manual 17 Colors make hsb color hue saturation brightness color Creates a color value object whose hue value is the f

Download Pdf Manuals

image

Related Search

Related Contents

ICC ICRDSAV59C coaxial connector  Manual de instrucciones C1x0  

Copyright © All rights reserved.
Failed to retrieve file