2

What is the point of type definition on method parameters on Caché Object (from Intersystems) since after it's pre-compiled to the .int format, it removes any typing information, thus making no difference at all?

VladV
  • 10,093
  • 3
  • 32
  • 48
Francisco Fiuza
  • 421
  • 1
  • 5
  • 4
  • Bit off-topic but you can use "oRef.%ClassName(1)" to confirm/check that the argument is an instance of the class that you actually want. – joebeeson May 02 '13 at 19:13

3 Answers3

1

Those types aren't used/checked internal to Cache code, but they are used when you expose your classes via XML, SQL, etc.

One would hope that in a future version Intersystems would start doing some compile-time type checking, but that may be too much to ask.

Clayton
  • 920
  • 1
  • 6
  • 13
0

If you're writing ANSI M code, you shouldn't have types at all. My guess is that this is specific to Intersystems code.

Matthew Cole
  • 1,329
  • 2
  • 18
  • 30
  • Yes, it shouldn't be there because it doesn't make any difference. It's just a fake typing feature like many others fake features. – Francisco Fiuza Sep 22 '08 at 13:37
0

There aren't really datatypes in Cache, so there is no type checking.

Daniel Kreiseder
  • 12,135
  • 9
  • 38
  • 59