Referencing chapters from the language specification in code.

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 24 10:10:11 PDT 2016


Hi,

I have my own conclusions with doing the following, but I'd thought
I'd ask for a second opinion before committing.

Given the freely available language specification linked below [1].
The order that all entries are listed in haven't changed since D1, or
at least to my memory.  So would it be considered reasonably safe to
reference these parts in code?

As an example, where the part in [square brackets] is the chapter reference.

  /* [12.12 Array Bounds Checking]:
     If an index is out of bounds, a RangeError exception is raised
     if detected at runtime.
     [...]
     Insertion of array bounds checking code at runtime should be
     turned on and off with a compile time switch.  */
  if (flag_array_bounds)
  {
    <compiler code that generates array bounds checking here>
  }

Or is there a more suitably stable reference I that can be used in
place of the dlang site?  In the process of increasing code
documentation of the internals of GDC, what I'd also like to
eventually end up with are justifications at each point for why the
compiler generates what it does.

Regards
Iain

[1]: http://dlang.org/dlangspec.pdf


More information about the Digitalmars-d mailing list