Dialog release announcements

Dialog version 0j/01 (library 0.35) is ready! Also make sure to get the companion release, Å-machine tools 0.4.1.

Spans

There is now a (span $) construct for applying style attributes to inline content, as a complement to (div $). The library provides style classes @bold and @italic by default, so you can do e.g.:

        (span @italic) { Lorem Ipsum } , he (span @bold) emphasized .

The old built-in predicates (bold), (italic), (reverse), (fixed pitch), (roman), and (unstyle) still work, but spans are preferable because they have full CSS support (when using the web interpreter) and provide a clean separation between content and presentation.

Better hyperlinks

The short form of (link) can now be followed by any kind of statement, not just a plain list of words. This makes it much easier to create clickable text on the fly:

(descr (fruit $Obj))
        You're really yearning to (link) { eat (the $Obj) }.

There’s also a new builtin, (clear links), that turns old hyperlinks into plain text. This is useful when the scope changes drastically, e.g. when moving to a different room.

Word manipulation

There are new builtins for splitting and joining words. This opens up all kinds of possibilities, like printing words backwards, counting the number of letters, or accepting transliterated input (such as “oe” for “ö”).

A new builtin, (unknown word $), checks if a word is listed in the game dictionary. This can be used to implement responses such as “You don’t need to use the word ‘borborygm’ in this story”. It is also required for the venerable “OOPS” command, which has now been added to the standard library.

Parentheses are now treated as individual words when parsing player input. The full set of such characters is: . , ; * ( ) "

From now on, such characters are also treated as separate words during (collect words) operations, even when they appear as part of larger words in the source code. This makes it a lot easier to work with object names like “purple envelope (open)”.

Also, when these single-character words are printed back as values, whitespace is inhibited before . , ; ) and after (. Earlier, if you wanted a comma in the printed name of an object, you had to do something like this:

(name #snowman)
        the tall , tall snowman

but now the following works exactly the same:

(name #snowman)
        the tall, tall snowman

Development and debugging

It is now possible to declare interfaces, a simple form of machine-readable documentation that describes how a predicate is supposed to work. Such declarations have been added to the standard library.

The compiler is able to trace unbound values, and print warnings about potential interface violations. Thanks to the interface declarations, the compiler is better equipped to report problems at the file and line where they actually originate, and not just at the place where they might cause problems at runtime.

The compiler will now also warn about variable names that only appear once in a rule definition, as these tend to be typos. To get rid of such a warning, change the variable into a wildcard ($).

Performance

(append $A $B $AB) is now built into the language, rather than defined by the library, for performance reasons.

The Å-machine backend produces smaller and faster storyfiles thanks to several new Å-machine 0.4 features.

Miscellaneous

  • Library: Fixed a bug in how reachability is determined. Thanks @hlship!

  • Library: (understand $ as any object $ preferably $) didn’t take the specified policy into account; this is now fixed.

  • Manual: Moved the section about the pristineness of nested objects to the end of the Items chapter.

Enjoy!

6 Likes