Question
· Jan 17

Are package names case sensitive?

The documentation at https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI...

Case-sensitive: variable names (other than the system variables) are case-sensitive. Names of classes and their members, names of routines and their entry points, names of include files and macros are all case sensitive.

Consider "fully qualified" class name: Package.subpackage.ClassName

What is the class name mentioned in the documentation? Package.subpackage.ClassName  or ClassName ?

It's unclear to me if in InterSystems/ObjectScript parlance class name includes also the packages or not.

In the other (non-related as my example has no SQL/%Persistent involved) documentation at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

Schema and table names are not case-sensitive; package and class names are case-sensitive.

But if I try to have both Package.subpackage.ClassName  and package.subpackage.ClassName I'll get:

ERROR #5092: Name conflict on class 'package.subpackage.ClassName' because class 'Package.subpackage.ClassName' has the same name but differs in case.

Or trying to have both Package.subpackage.ClassName and package.subpackage.ClassNameTwo gives me:

ERROR #5093: Name conflict on class 'package.subpackage.ClassNameTwo' because package 'Package' has the same name but differs in case.

So it looks to me the package names are case in-sensitive. To me this is an inaccuracy/bug in the documentation and I'll report that if no-one else objects :)

This is related to "IPM modularization"-effort where I'm trying to apply de-facto naming conventions but the package name case in-sensitivity prevents us to mix the new IPM code with old code (mapped from other namespaces).

Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.1.2 (Build 574_0_22161U) Tue Jan 24 2023 11:05:57 EST
Discussion (6)2
Log in or sign up to continue

This is the rare case where the statement “RTFM” leads you down the wrong path or, better said, reading the documentation confuses you more than informs.

So you have to change your viewpoint. And that depends on, what do you do.
If you work with ObjectScript (and of course, with objects) then your first citation "Case-sensitive: variable names..." holds.

But if you are more that SQL guy, who day in, day out busy with Updates, Inserts and Selects, then you will say, "No, no, my table and field names aren't case sensitive".

And now we sit in the middle of those two worlds, where a case sensitive Objectscript meets a case insensitive SQL world.

So what is the status quo?

All the (persistent) classes can be seen (and used) as SQL tables, but this freedom has its price (or, better, its consequence): you must be aware, that the two worlds (ObjectScript and SQL) do not use the same case-rule.

An ObjecScript class Test.Person can be named in SQL as Test.Person, as TEST.Person, as TEST.PERSON or even as TeSt.PeRsOn.

To de-escalate the resulting confusion, the following rule was added:

It's forbidden to have two ObjectScript classes, which have the same spelling but (somewhere) a different case (the Studio wizard checks this). I hope, this helps a bit...

Hi @Luc Morningstar, if VS Code is not meeting your needs then I would be happy to hear about how we can improve it. We take bug reports and feature requests via GitHub issues. Please see these docs on how to report issues from VS Code and which types of issues go to which extension. I would also like to note that VS Code will fail to save a class if its name differs from another class name only in case.