Presentation is loading. Please wait.

Presentation is loading. Please wait.

Types in APL – The SimCorp Way Dyalog User Conference 2007 Lars Stampe Villadsen, SimCorp A/S (Denmark)

Similar presentations


Presentation on theme: "Types in APL – The SimCorp Way Dyalog User Conference 2007 Lars Stampe Villadsen, SimCorp A/S (Denmark)"— Presentation transcript:

1 Types in APL – The SimCorp Way Dyalog User Conference 2007 Lars Stampe Villadsen, SimCorp A/S (Denmark)

2 2 Agenda Company presentation (short ) It is all about structure Defined types in SimCorp Dimension

3 3 Business Idea SimCorp offers integrated software solutions to financial service providers supporting their activities worldwide on the financial markets. Our solutions are firmly based on our high quality standards and our insight into financial theory, methods and practices.

4 4 2007SimCorp sells IT2 2003SimCorp Dimension 2000TMS2000 full STP product 1999 IT2 acquired to substitute TRACTS 1998TMS2000 most important product 1997Sale of Actuarial department Official launch of TMS2000 1996First TMS2000 implementations 1995TMS2000 development intensified Getting Focused 1991Risk management modules 1990Financial analytics and library 1985Building society systems Money market systems Pricing models for derivatives Treasury systems SimCorp Dimension era Customised software SimCorp History

5 5 It is all about structure Big house – strict rules Naming conventions: ^[a-z_][a-z0-9_]+$Local variable: dates ^[a-z][a-zA-Z0-9_]+[A-Z] [a-zA-Z0-9_]+[a-z]$Function: dcAndBasicParts ^_[a-z0-9] [a-z0-9_]+$Local d-func: _swap ^[a-z][a-zA-Z0-9_]+[A-Z] [a-zA-Z0-9_]+[A-Z]$Global variable: intTAB ^[A-Z][A-Z0-9_]+$Utility function: FSI Reserved prefixes: ^t[A_Z0_9_]+$Constant for a table: tIBI ^p[A_Z0_9_]+$Constant for a ’pointer’: pSECSHORT ^d[A_Z0_9_]+$Constant for an enumeration: dIT_BOND …

6 6 It is all about structure – cont. Lets make a simple function: datessince„ex1Main date © Calculate dayes between today and specified date. toDay„10000 100 100ƒ3†ŒTS datessince„toDay-date ex1Main 20071001 1 CHK 'ex1Main' ©... Comply with standards ? ERROR: Missing header: ex1Main ERROR: Missing header (©0©): ex1Main ERROR: Parameters/result not specified in ex1Main: date datessince WARNING: References to unknown functions in ex1Main: toDay

7 7 It is all about structure – cont. datessince„ex1Main date ©0© ©3© date : ©4© datessince : © Calculate dayes between today and specified date. toDay„10000 100 100ƒ3†ŒTS datessince„toDay-date Comment conventions: ©0©General description of function ©2©Description of left argument ©3©Description of right argument ©4©Description of result

8 8 It is all about structure – cont. Clean up: datessince„ex1Main date;today ©0© Calculate days between today and specified date. ©3© date : Reference date ©4© datessince : Days between reference date and today today„10000 100 100ƒ3†ŒTS datessince„today-date CHK 'ex1Main' ©... Comply with standards ? Yes!

9 9 It is all about structure – cont. But it is so hard to program in Power Point so we go the dangerous way – live action!

10 10 Defined types in SimCorp Dimension vtBOOLBoolean. Valid values are bFALSE and bTRUE (wrapping 0 and 1). vtCHARCharacter vtDATEAPL internal date (integer of the form yyyymmdd). vtDOMAIN(dDOMAIN)Domain. Valid values are members of domain dDOMAIN. vtDOUBLEFloating point number. vtENUM(APL expr.)Enumeration. Valid values are the result of the enclosed APL expression. vtINTInteger. vtNULLNull. Valid values are numeric null and text null. vtSTRINGString of characters. Note that also a single character will be accepted as a string. vtTIMEAPL Time of day fraction. Floating point number between 0 and 1. vtTSFull APL time stamp. Floating point number. vtUINTUnsigned integer. vtVARIANTThe joker type. Variables not type declared are considered variants. vtZEROZero. Valid values are – surprise – 0.

11 11 Defined types in SimCorp Dimension – cont. The named variables types can be used in the function comment headers to specify argument and result types. They can be grouped together to form more complex variables, e.g, {vtUINT {vtSTRING vtTS}} A 2-vector consisting of an unsigned integer and a 2-vector consisting of a string and a timestamp. {vtDOUBLE vtDATE vtDOMAIN(dPRICETYPE)} A 3-vector consisting of a float, a date and a domain value in the domain dPRICETYPE.

12 12 Defined types in SimCorp Dimension – cont. Arrays of different dimensions of a variable type can be specified using “[“, “]” and “;”, e.g, vtBOOL[]A vector of Booleans. vtINT[;]A 2-dimensional array of integers. vtSTRING[2-]A vector of length two or more containing strings.

13 13 Defined types in SimCorp Dimension – cont. Sometimes several types are allowed for a variable. Use “|” to separate different choices, e.g, vtDATE|vtZERO A scalar date or zero. vtDOUBLE|vtNULL A float or null. Any combination of the above is allowed, e.g, {vtDOUBLE|vtSTRING|vtNULL}[;5-10]A matrix with between 5 and 10 columns containing a mix of floats, strings and nulls.

14 14 Defined types in SimCorp Dimension – cont. It is possible to specify the shape of a variable relative to another variable in the argument and result. The main limitation is that the shape of a variable can only be specified relative to an already declared variable, e.g, fooGoo arg;flds;mat;opt ©0© A function. ©3© arg[1] : mat As vtDOUBLE[;] : Matrix of floats ©3© [2] : flds As vtUINT[$3:mat:2] : Field list corresponding to ©3© [3] : opt As vtBOOL : Option ©5© FST: VarTypes mat flds opt„arg


Download ppt "Types in APL – The SimCorp Way Dyalog User Conference 2007 Lars Stampe Villadsen, SimCorp A/S (Denmark)"

Similar presentations


Ads by Google