DIRECTORY TSTypes; TSGlue: CEDAR DEFINITIONS IMPORTS TSTypes = BEGIN OPEN TSTypes; Glue: TYPE = RECORD [space: Dimn, stretch: Dimn, shrink: Dimn]; zeroGlue: Glue = [zeroDimn, zeroDimn, zeroDimn]; fil: Dimn = [texPts: 1.0E+4]; fill: Dimn = [texPts: 1.0E+8]; filll: Dimn = [texPts: 1.0E+12]; Flex: TYPE = ARRAY [0..3] OF Dimn; zeroFlex: Flex = [zeroDimn, zeroDimn, zeroDimn, zeroDimn]; GlueSum: TYPE = RECORD [space: Dimn, stretch: Flex, shrink: Flex]; zeroGlueSum: GlueSum = [zeroDimn, zeroFlex, zeroFlex]; AddGlue: PROCEDURE [t: GlueSum, g: Glue] RETURNS [s: GlueSum] = INLINE { s _ t; s.space.texPts _ s.space.texPts + g.space.texPts; SELECT ABS[g.stretch.texPts] FROM < fil.texPts => s.stretch[0].texPts _ s.stretch[0].texPts + g.stretch.texPts; < fill.texPts => s.stretch[1].texPts _ s.stretch[1].texPts + g.stretch.texPts; < filll.texPts => s.stretch[2].texPts _ s.stretch[2].texPts + g.stretch.texPts; ENDCASE => s.stretch[3].texPts _ s.stretch[3].texPts + g.stretch.texPts; SELECT ABS[g.shrink.texPts] FROM < fil.texPts => s.shrink[0].texPts _ s.shrink[0].texPts + g.shrink.texPts; < fill.texPts => s.shrink[1].texPts _ s.shrink[1].texPts + g.shrink.texPts; < filll.texPts => s.shrink[2].texPts _ s.shrink[2].texPts + g.shrink.texPts; ENDCASE => s.shrink[3].texPts _ s.shrink[3].texPts + g.shrink.texPts; }; GlueFromSum: PROCEDURE [s: GlueSum] RETURNS [Glue] = INLINE { RETURN[[space: s.space, stretch: [s.stretch[0].texPts + s.stretch[1].texPts + s.stretch[2].texPts + s.stretch[3].texPts], shrink: [s.shrink[0].texPts + s.shrink[1].texPts + s.shrink[2].texPts + s.shrink[3].texPts]]] }; GlueSet: TYPE = RECORD[value: REAL]; zeroGlueSet: GlueSet = [value: 0]; overfullGlueSet: GlueSet = [value: -1.0625]; SetGlue: PROCEDURE [desired: Dimn, g: Glue] RETURNS [GlueSet]; GlueBadness: PROCEDURE [GlueSet] RETURNS [Badness]; FixGlue: PROCEDURE [glue: Glue, set: GlueSet] RETURNS [d: Dimn] = INLINE { d _ IF set.value<0 THEN AddDimn[glue.space, RealDimn[set.value, glue.shrink]] ELSE AddDimn[glue.space, RealDimn[set.value, glue.stretch]] }; END. Michael Plass, November 2, 1982 10:03 am. CEDARized. 0TSGlue.mesa Definitions pertaining to glue Michael Plass, November 2, 1982 10:03 am Last Edited by: Beach, June 2, 1983 1:51 pm Your basic glue Constants for making infinite glue Glue sums have a special representation to allow cancellation of infinite glue items without undue loss of precision. Κλ– "cedar" style˜JšΟc ™ Jš™Jšœ™)J™+šΟk ˜ J˜J˜—Jšœžœžœ ˜+Jšžœžœ ˜J˜Jš™Jšœžœžœ,˜?J˜0J˜Jš"™"J˜J˜J˜ J˜Jšu™uJšœžœžœžœ˜"J˜:Jšœ žœžœ,˜BJ˜6J˜šΟnœž œžœžœ˜HJ˜J˜1šžœžœž˜!J˜MJ˜NJ˜OJšžœA˜H—šžœžœž˜ J˜JJ˜KJ˜LJšžœ>˜E—J˜J˜—šŸ œž œžœ žœ˜=šžœ˜J˜aJ˜]—J˜J˜—Jšœ žœžœžœ˜$J˜"J˜,J˜JšŸœž œžœ ˜>J˜JšŸ œž œ žœ ˜3J˜šŸœž œžœ žœ˜Jšœžœ žœ6˜MJšžœ7˜;—J˜J˜—Jšžœ˜J˜5—…—D _