Vision Messages: Block

| Home | Block Class | Message XRef | Messages (General) |

Profile of Class Block


Object
  | 
Function
  | 
ComputedFunction
  | 
  +--- Block


A Block is a set of one or more expressions that are viewed together
as a unit.  Each expression in a block is known as a statement.
Statements are separated by the character ; .  The block itself is
surrounded by square brackets.  The general form for a block is:  

     [ statement1 ;
       statement2 ;
       statement3 ;
       . . .
     ] ;


Message Index

o asClosure: anObject
o asMethod
o asOf: aDate
o asRowsColumns
o asSelf
o asUndelimitedString
o aveForDateRange: aDateRange
o cGrowForDateRange: aDateRange
o changeLag: aDateOffset
o changeLead: aDateOffset
o classDescriptor
o convergeTo: aValue within: tolerance initialGuess: guess
o convertFrom: string
o current
o defaultInstance
o displayAll
o divertDelimitedOutput
o divertOutput
o environment
o environment: anObject
o environmentWith: anObject
o environmentWith: object1 and: object2
o environmentWith: obj1 and: obj2 and: obj3
o environmentWith: obj1 and: obj2 and: obj3 and: obj4
o environmentWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5
o environmentWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5 and: obj6
o extractForDateRange: aDateRange
o formatForExcel
o formatForPRN
o gMeanForDateRange: aDateRange
o isBlock
o lag: aDateOffset
o latest
o lead: aDateOffset
o lsGrowForDateRange: aDateRange
o maxForDateRange: aDateRange
o medianForDateRange: aDateRange
o minForDateRange: aDateRange
o my
o pctChangeLag: aDateOffset
o pctChangeLead: aDateOffset
o print
o productForDateRange: aDateRange
o selector
o self
o sprint
o stdDevForDateRange: aDateRange
o totalForDateRange: aDateRange
o value
o value: anObject
o valueWith: anObject
o valueWith: obj1 and: obj2
o valueWith: obj1 and: obj2 and: obj3
o valueWith: obj1 and: obj2 and: obj3 and: obj4
o valueWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5
o valueWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5 and: obj6
o whatAmI
o whileTrue: aBlock


Messages

o asClosure:

Synopsis:
Block asClosure: anObject

Type: Method          Returns: Object

Parameters:

1 - Object

o asMethod

Synopsis:
Block asMethod

Description:

Converts Block to Method

Type: Primitive          Returns: Method

o asOf:

Synopsis:
Block asOf: aDate

Description:

Returns the value of the Block as of the supplied date. If no value is stored for the date, the closest date prior to the supplied date is used.

Type: Method          Returns: Object

Parameters:

1 - Date

Also Defined At:
| TimeSeries |

o asRowsColumns

Synopsis:
Block asRowsColumns

Description:

Executes the recipient block and returns a list of strings representing the rows of the output where each element of the list is extended by the variable 'columns' which represent the columns of output for the row. Each element in 'columns' is a string that corresponds to each print statement in the recipient block.

Type: Method          Returns: List

o asSelf

Synopsis:
Block asSelf

Description:

Returns the original object.

Type: Primitive          Returns: Block

Also Defined At:
| Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o asUndelimitedString

Synopsis:
Block asUndelimitedString

Description:

Returns the block as a string with surrounding brackets [ ] removed.

Type: Method          Returns: String

o aveForDateRange:

Synopsis:
Block aveForDateRange: aDateRange

Description:

Computes the average value of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o cGrowForDateRange:

Synopsis:
Block cGrowForDateRange: aDateRange

Description:

Computes the compound growth rate of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o changeLag:

Synopsis:
Block changeLag: aDateOffset

Description:

Computes the absolute change between the value of the block as of the default date and an earlier relative date.

Type: Method          Returns: Number

Parameters:

1 - DateOffset

Also Defined At:
| TimeSeries |

o changeLead:

Synopsis:
Block changeLead: aDateOffset

Description:

Computes the absolute change between the value of the block as of the default date and a future relative date.

Type: Method          Returns: Number

Parameters:

1 - DateOffset

Also Defined At:
| TimeSeries |

o classDescriptor

Synopsis:
Block classDescriptor

Description:

Reference to the object which describes the class. Class level information is stored here.

Type: Constant          Returns: Object

Also Defined At:
| Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o convergeTo:within:initialGuess:

Synopsis:
Block convergeTo: aValue within: tolerance initialGuess: guess

Description:

Executes recipient block until it converges to within tolerance distance from supplied value using guess as the initial guess. The recipient block contains the function you wish to evaluate. Iteration terminates if value converges to within tolerance or a maximum of forty iterations have been reached.

Type: Method          Returns: Object

Parameters:

1 - Number
2 - Number
3 - Number

o convertFrom:

Synopsis:
Block convertFrom: string

Description:

This message converts the supplied string to an instance of the recipient's class if applicable, returning NA otherwise. The definition at Object will lookup the string in the class' naming dictionary, if defined. The version at String returns the recipient stripped of any extensions. The versions at Number, Integer, Double, and Float convert the recipient to a numeric value if possible. The version at Date converts the recipient to a Date using the 'asDate' message defined at String. The version at Boolean returns TRUE if the recipient contains an upper/lower case combination of 'true' and FALSE if the recipient contains an upper/lower case combination of 'false'. The version at block returns a block containing the string as a message. This message is called by the 'as:' message at String.

Type: Method          Returns: Object

Also Defined At:
| Boolean | Date | Number | Object | String | Undefined |

o current

Synopsis:
Block current

Description:

Returns current environment of block.

Type: Primitive          Returns: Object

o defaultInstance

Synopsis:
Block defaultInstance

Description:

Returns the default instance of the recipient object's class

Type: Constant          Returns: Block

Also Defined At:
| Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o displayAll

Synopsis:
Block displayAll

Description:

Displays block definition (see TimeSeries)

Type: Method          Returns: Object

Also Defined At:
| TimeSeries |

o divertDelimitedOutput

Synopsis:
Block divertDelimitedOutput

Description:

Prints block with marked areas for internal formatting purposes.

Type: Primitive          Returns: String

o divertOutput

Synopsis:
Block divertOutput

Description:

Captures output as a string instead of to terminal.

Type: Primitive          Returns: String

o environment

Synopsis:
Block environment

Description:

Returns block's environment.

Type: Primitive          Returns: Object

o environment:

Synopsis:
Block environment: anObject

Description:

Return's block's environment, evaluated with one input.

Type: Primitive          Returns: Object

Parameters:

1 - Object

o environmentWith:

Synopsis:
Block environmentWith: anObject

Description:

Returns block's environment, evaluated with one inputs.

Type: Primitive          Returns: Object

Parameters:

1 - Object

o environmentWith:and:

Synopsis:
Block environmentWith: object1 and: object2

Description:

Returns block's environment, evaluated with two inputs.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object

o environmentWith:and:and:

Synopsis:
Block environmentWith: obj1 and: obj2 and: obj3

Description:

Returns block's environment, evaluated with three inputs.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object

o environmentWith:and:and:and:

Synopsis:
Block environmentWith: obj1 and: obj2 and: obj3 and: obj4

Description:

Returns block's environment, evaluated with four inputs.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object
4 - Object

o environmentWith:and:and:and:and:

Synopsis:
Block environmentWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5

Description:

Returns block's environment, evaluated with five inputs.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object
4 - Object
5 - Object

o environmentWith:and:and:and:and:and:

Synopsis:
Block environmentWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5 and: obj6

Description:

Returns block's environment, evaluated with six inputs.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object
4 - Object
5 - Object
6 - Object

o extractForDateRange:

Synopsis:
Block extractForDateRange: aDateRange

Description:

Extracts the value of the recipient block for each point in the date range and returns a time series containing those date-value pairs.

Type: Method          Returns: TimeSeries

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o formatForExcel

Synopsis:
Block formatForExcel

Description:

Executes the recipient block and generates tab-delimited output suitable for loading into Excel.

Type: Method          Returns: String

Also Defined At:
| String |

o formatForPRN

Synopsis:
Block formatForPRN

Description:

Executes the recipient block and generates PRN-style output.

Type: Method          Returns: String

Also Defined At:
| String |

o gMeanForDateRange:

Synopsis:
Block gMeanForDateRange: aDateRange

Description:

Computes the geometric mean value of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o isBlock

Synopsis:
Block isBlock

Description:

Returns the value TRUE when sent to any block.

Type: Constant          Returns: TRUE

Also Defined At:
| Object |

o lag:

Synopsis:
Block lag: aDateOffset

Description:

Returns the value of the block as of a date relative to the default date. The derived date is defined as: ^date - anOffset. If no value is stored for the derived date, the closest date prior to the supplied date is used.

Type: Method          Returns: Object

Parameters:

1 - DateOffset

Also Defined At:
| TimeSeries |

o latest

Synopsis:
Block latest

Description:

Returns the value of the recipient block as of the current date. Identical to [ ] asOf: ^today.

Type: Method          Returns: Object

Also Defined At:
| TimeSeries |

o lead:

Synopsis:
Block lead: aDateOffset

Description:

Returns the value of the block as of a date relative to the default date. The derived date is defined as: ^date + aDateOffset. If no value is stored for the derived date, the closest date prior to the supplied date is used.

Type: Method          Returns: Object

Parameters:

1 - DateOffset

Also Defined At:
| TimeSeries |

o lsGrowForDateRange:

Synopsis:
Block lsGrowForDateRange: aDateRange

Description:

Computes the least squares growth value of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o maxForDateRange:

Synopsis:
Block maxForDateRange: aDateRange

Description:

Computes the maximum value of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o medianForDateRange:

Synopsis:
Block medianForDateRange: aDateRange

Description:

Computes the median value of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o minForDateRange:

Synopsis:
Block minForDateRange: aDateRange

Description:

Computes the minimum value of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o my

Synopsis:
Block my

Description:

Returns environment in which block was defined.

Type: Primitive          Returns: Object

o pctChangeLag:

Synopsis:
Block pctChangeLag: aDateOffset

Description:

Computes the percent change between the value of the block as of the default date and an earlier relative date.

Type: Method          Returns: Number

Parameters:

1 - DateOffset

Also Defined At:
| TimeSeries |

o pctChangeLead:

Synopsis:
Block pctChangeLead: aDateOffset

Description:

Computes the percent change between the value of the block as of the default date and a later relative date.

Type: Method          Returns: Number

Parameters:

1 - DateOffset

Also Defined At:
| TimeSeries |

o print

Synopsis:
Block print

Description:

Redefines the standard print message to print out the contents of the recipient block.

Type: Primitive          Returns: Block

Also Defined At:
| Date | DateOffset | DateRange | Entity | IndexedList | List | Object | String | TimeSeries | Undefined |

o productForDateRange:

Synopsis:
Block productForDateRange: aDateRange

Description:

Computes the product of the values of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o selector

Synopsis:
Block selector

Description:

Returns the selector for the block (i.e., the message name).

Type: Primitive          Returns: Selector

o self

Synopsis:
Block self

Description:

Returns recipient Block.

Type: Primitive          Returns: Block

o sprint

Synopsis:
Block sprint

Description:

Returns recipient Block as string.

Type: Primitive          Returns: String

o stdDevForDateRange:

Synopsis:
Block stdDevForDateRange: aDateRange

Description:

Computes the standard deviation of the values of the recipient Block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o totalForDateRange:

Synopsis:
Block totalForDateRange: aDateRange

Description:

Computes the sum of the values of the recipient block over the specified date range.

Type: Method          Returns: Number

Parameters:

1 - DateRange

Also Defined At:
| TimeSeries |

o value

Synopsis:
Block value

Description:

Evaluates the recipient block.

Type: Primitive          Returns: Object

Also Defined At:
| Object | TimeSeries |

o value:

Synopsis:
Block value: anObject

Description:

Evaluates the recipient block with one parameter.

Type: Primitive          Returns: Object

Parameters:

1 - Object

o valueWith:

Synopsis:
Block valueWith: anObject

Description:

Evaluates the recipient block with one parameter.

Type: Primitive          Returns: Object

Parameters:

1 - Object

o valueWith:and:

Synopsis:
Block valueWith: obj1 and: obj2

Description:

Evaluates the recipient block with two parameters.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object

o valueWith:and:and:

Synopsis:
Block valueWith: obj1 and: obj2 and: obj3

Description:

Evaluates the recipient block with three parameters.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object

o valueWith:and:and:and:

Synopsis:
Block valueWith: obj1 and: obj2 and: obj3 and: obj4

Description:

Evaluates the recipient block with four parameters.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object
4 - Object

o valueWith:and:and:and:and:

Synopsis:
Block valueWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5

Description:

Evaluates the recipient block with five parameters.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object
4 - Object
5 - Object

o valueWith:and:and:and:and:and:

Synopsis:
Block valueWith: obj1 and: obj2 and: obj3 and: obj4 and: obj5 and: obj6

Description:

Evaluates the recipient block with six parameters.

Type: Primitive          Returns: Object

Parameters:

1 - Object
2 - Object
3 - Object
4 - Object
5 - Object
6 - Object

o whatAmI

Synopsis:
Block whatAmI

Description:

Returns the string 'Block'.

Type: Constant          Returns: String

Also Defined At:
| Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o whileTrue:

Synopsis:
Block whileTrue: aBlock

Description:

While recipient block evaluates to TRUE, executes supplied block

Type: Primitive          Returns: Object

Parameters:

1 - Block