Parties Who Own ScriptsΒΆ

There are three parties of people who own DkCoder scripts:

  1. You (the first party)
  2. Us (the second party)
  3. Them (the third parties)

Here is a handy reference table that summarizes the distinctions. You won't understand the table right now and that is OK. We'll cover "Us" and "Them" in later sections in a future edition of DkCoder, but it is nice to have all the information in one place. All you need to remember is if you have a question about parties, this is the table to check.

PartyCode GeneratorsTermsCompiled Initially
YouDuneIde (default), DuneCheckedYes
UsDuneNo
ThemDuneIde (default), DuneCheckedNo

In this section we'll talk about where your You scripts go.

Your scripts must be placed in specific paths. Here is an example which you've seen in the Quick Walkthrough, and the general pattern you must follow:

.
└── src/
    β”œβ”€β”€ DkHelloScript_Std/
    β”‚   └── Example001.ml
    └── <Libraryowner><Project>_<Unit>/
        │── <Modulename1>.ml
        └── <Modulename2>/
            │── <Modulename3>.ml
            │── <Modulename3>.mli
            └── <Modulename4>/
                └── <Modulename5>.ml

In the example above the DkHelloScript_Std is a library. A library is an organization of files and directories. These directories can have subdirectories, and those subdirectories can have their own subdirectories (etc.).

Any directory under src/ that is named in the format:

<Libraryowner><Project>_<Unit>

is also a library.

ComponentPartWhy
DkLibrary ownerA short identifier for which party owns the source code
HelloScriptProjectConventionally this is a name related to your source code repository, but it can be any organizational name you want. You might, for example, want to name it your product name.
StdUnitConventionally if you want to create a single library in a project, you use the name Std. Once you get too much code in your project, you can use the Unit to separate your code into more manageable, smaller pieces.

We'll define the exact format of <Libraryowner>, <Project>, and <Unit> below.

You can place your script into the library directory, or into a subdirectory (or subdirectory of a subdirectory, etc.) named according to the <Modulename>/ format defined below, as long as your script is named according to the <Modulename>.ml format. There is also an optional <Modulename>.mli script interface which is not covered in this article.

PartExamplesRules
Library ownerDk, Acme, Blue123The Library owner must start with an ASCII capital letter and have a lowercase ASCII second letter; the remaining characters (if any) must be lowercase ASCII letters and/or ASCII digits.</td>
ProjectX, Ab, Widgets, WidgetsPlusThe Project must start with an ASCII capital letter. The remaining characters (if any) must be ASCII letters (any case) and/or ASCII digits. Conventionally you use something similar to your source code repository name as the Project.</td>
UnitStd, V1, XThe library unit must start with an ASCII capital letter. The remaining characters (if any) must be ASCII letters (any case) and/or ASCII digits and/or underscores (_). Conventially the main unit for your project is named Std. Once you get too much code in your project, you can use the Unit to separate your code into more manageable, smaller pieces.</td>
ExamplesCounter ExamplesRule
Acme, Acme_Two, XDkHelloScript_StdThe module name MUST NOT be a valid <Libraryowner><Project>_<Unit> name.
Acme, Acme*Two, X12345, someThingThe module name must start with an ASCII capital letter. The remaining characters (if any) must be ASCII letters (any case) and/or ASCII digits and/or underscores (*).