| 1 |
<html> |
| 2 |
<title>TADS 3 Change History</title> |
| 3 |
|
| 4 |
<style type="text/css"> |
| 5 |
<!-- |
| 6 |
body { |
| 7 |
font: 10pt/14pt Verdana, Arial, Helvetica, Sans-Serif; |
| 8 |
} |
| 9 |
h1 { |
| 10 |
font: 18pt/24pt Georgia, Times New Roman, New York, Times, Serif; |
| 11 |
color: #400060; |
| 12 |
} |
| 13 |
h2 { |
| 14 |
font: 14pt/18pt Georgia, Times New Roman, New York, Times, Serif; |
| 15 |
color: #600060; |
| 16 |
} |
| 17 |
h3 { |
| 18 |
background: #f0f0f0; |
| 19 |
border-top: 1px solid #d8d8d8; |
| 20 |
margin-top: 2.5em; |
| 21 |
padding: 1ex 1ex 1ex 1ex; |
| 22 |
font: 12pt/14pt Georgia, Times New Roman, New York, Times, Serif; |
| 23 |
color: #600060; |
| 24 |
} |
| 25 |
ul { |
| 26 |
margin-left: 0ex; |
| 27 |
padding-left: 1ex; |
| 28 |
} |
| 29 |
li { |
| 30 |
margin: 0.75em 0ex 0.75em 0em; |
| 31 |
padding-bottom: 1em; |
| 32 |
border-bottom: 1px dotted #606060; |
| 33 |
list-style: none; |
| 34 |
} |
| 35 |
li.last, li:last-child { |
| 36 |
border-bottom: none; |
| 37 |
} |
| 38 |
li ul { |
| 39 |
padding-left: 2em; |
| 40 |
margin-top: 0.75em; |
| 41 |
margin-left: 0em; |
| 42 |
} |
| 43 |
li li { |
| 44 |
margin-top: 0.25em; |
| 45 |
margin-bottom: 0.25em; |
| 46 |
border: none; |
| 47 |
list-style: disc outside; |
| 48 |
} |
| 49 |
li p { |
| 50 |
margin-top: 0.5em; |
| 51 |
margin-bottom: 0.5em; |
| 52 |
} |
| 53 |
//--> |
| 54 |
</style> |
| 55 |
|
| 56 |
<body> |
| 57 |
|
| 58 |
<h1>TADS 3 Change History</h1> |
| 59 |
|
| 60 |
<p>This is a list of changes to the TADS 3 core system: the language, |
| 61 |
the built-in classes and functions, the compiler and related build |
| 62 |
tools, the debugger, and the interpreter virtual machine. The change |
| 63 |
history is organized by release, with the most recent release first. |
| 64 |
|
| 65 |
<p>(This page only covers changes to the core TADS language and |
| 66 |
Virtual Machine engine. There are separate release notes for most |
| 67 |
operating system install packages - HTML TADS, FrobTADS, CocoaTADS, |
| 68 |
etc. For changes to the Adv3 library, see |
| 69 |
<a href="../lib/adv3/changes.htm">Recent Library Changes</a>.) |
| 70 |
|
| 71 |
|
| 72 |
<h3>Changes for 3.1.3 (May 16, 2013)</h3> |
| 73 |
|
| 74 |
<ul> |
| 75 |
|
| 76 |
<li>The compiler now allows nested embedded "<< >>" |
| 77 |
expressions in strings. Nesting wasn't allowed in the past; the |
| 78 |
compiler now allows nesting up to a depth limit (currently 10 |
| 79 |
levels deep). For example, this is now valid: |
| 80 |
|
| 81 |
<pre> |
| 82 |
local x = 1; |
| 83 |
"This is the main string. << |
| 84 |
"This is a nested string: x=<<x>>." |
| 85 |
>> Back to the main string."; |
| 86 |
</pre> |
| 87 |
|
| 88 |
<li>In the past, HTML <PRE> blocks were problematic if you |
| 89 |
wanted to use <PRE> for precise indentation. The complication |
| 90 |
was that the output formatter in the VM pre-filtered the text sent to |
| 91 |
the HTML parser to consolidate each run of whitespace into a single |
| 92 |
space. If you wanted to use spaces in a <PRE> block for |
| 93 |
alignment purposes, you had to use quoted spaces (<tt>"\ "</tt> sequences) |
| 94 |
to make sure that all of the spaces were sent through to the HTML parser. |
| 95 |
|
| 96 |
<p>Now, the VM formatter layer watches for <PRE> tags. Within a |
| 97 |
<PRE> block, the VM formatter passes spaces and newlines through |
| 98 |
to the HTML parser without any filtering. This change addresses |
| 99 |
<a href="http://bugdb.tads.org/view.php?id=0000178">bug #0000178</a>. |
| 100 |
|
| 101 |
<p>Note that there's another slight complication if you're writing |
| 102 |
multi-line preformatted blocks with spacing for indentation. The |
| 103 |
compiler normally removes the spaces that follow a line break within |
| 104 |
a string. The new compiler behavior described below gives you more |
| 105 |
precise control over this, as does the new |
| 106 |
<tt>#pragma newline_spacing(preserve)</tt> described later. |
| 107 |
|
| 108 |
<li>In the <tt>#pragma newline(collapse)</tt> and <tt>#pragma |
| 109 |
newline(delete)</tt> modes (see below), you can now override the default |
| 110 |
line break handling for a particular line in a string by writing an |
| 111 |
explicit <tt>\n</tt> sequence at the very end of the line. When a |
| 112 |
line within a string ends in <tt>\n</tt>, followed by a line break and |
| 113 |
the continuation of the string on the next line, the compiler |
| 114 |
preserves the whitespace at the start of the next line exactly as |
| 115 |
written. For example, consider the following string definitions, |
| 116 |
assuming that we're in the normal "collapse" mode for newline spacing: |
| 117 |
|
| 118 |
<pre> |
| 119 |
f() |
| 120 |
{ |
| 121 |
local a = 'a |
| 122 |
b'; |
| 123 |
local x = 'x\n |
| 124 |
y'; |
| 125 |
} |
| 126 |
</pre> |
| 127 |
|
| 128 |
<p>For the first string, the compiler converts the |
| 129 |
line break after the letter "a" and all of the whitespace at the |
| 130 |
start of the next line into a single space, so the string's actual |
| 131 |
contents end up as though you had written <tt>local a = 'a b';</tt>, |
| 132 |
with just one space between the two letters. But in the second |
| 133 |
string, we've written an explicit <tt>\n</tt> at the end of the line, |
| 134 |
telling the compiler to put an explicit line break into the string |
| 135 |
and to preserve the subsequent whitespace. This string is equivalent |
| 136 |
to writing <tt>local x = 'x\n y';</tt>, |
| 137 |
with the five spaces at the start of the second line kept intact. |
| 138 |
|
| 139 |
<li>The <tt>#pragma newline_spacing</tt> directive now has three modes: |
| 140 |
|
| 141 |
<ul> |
| 142 |
<li><tt>collapse</tt> mode (equivalent to the old <tt>on</tt> mode) |
| 143 |
collapses each line break within a string and any subsequent run |
| 144 |
of whitespace (at the start of the next line) into a single space. |
| 145 |
|
| 146 |
<li><tt>delete</tt> mode (equivalent to the old <tt>off</tt> mode) |
| 147 |
removes each line break and any subsequent run of whitespace, |
| 148 |
mashing the text of the two lines together without any spacing. |
| 149 |
|
| 150 |
<li><tt>preserve</tt> mode (new in this version) preserves spacing |
| 151 |
exactly as written in the source code, with the line break replaced |
| 152 |
by a <tt>\n</tt> (newline) character, and subsequent whitespace |
| 153 |
at the start of the next line kept intact. |
| 154 |
</ul> |
| 155 |
|
| 156 |
<p>Existing code that uses the pragma will continue to work without |
| 157 |
any changes, because the former "on" mode is equivalent to the new |
| 158 |
"collapse" mode, and the former "off" mode is equivalent to "delete" |
| 159 |
mode. The compiler continues to accept the old names, although new |
| 160 |
code should use the new names for better clarity. |
| 161 |
|
| 162 |
<li>The Web UI library code had a bug that prevented dialogs (such |
| 163 |
as the display preferences dialog) from displaying properly on |
| 164 |
Internet Explorer 9 and later. This has been corrected. |
| 165 |
|
| 166 |
(<a href="http://bugdb.tads.org/view.php?id=0000194">bugdb.tads.org #0000194</a>) |
| 167 |
|
| 168 |
|
| 169 |
<li>The compiler error message for a symbol token containing an |
| 170 |
accented letter or other non-ASCII character has been improved. In |
| 171 |
the past, the compiler treated a non-ASCII character as though it were |
| 172 |
a symbol delimiter; for example, this had the effect of splitting |
| 173 |
<tt>naïve</tt> into three tokens: <tt>na</tt>, <tt>ï</tt>, |
| 174 |
<tt>ve</tt>. The compiler then reported an "invalid character" error |
| 175 |
for the <tt>ï</tt> character. The compiler now assumes that any |
| 176 |
non-ASCII character that's adjacent to a character that's valid in a |
| 177 |
symbol (i.e., not separated by any spaces or punctuation marks) is |
| 178 |
meant to be part of the symbol token, so rather than reporting the |
| 179 |
invalid character in isolation, the compiler now reports the error in |
| 180 |
terms of the entire token containing the non-ASCII character. This |
| 181 |
should make it easier to pinpoint the source location of this type of |
| 182 |
error. The compiler also displays the numeric Unicode value of the |
| 183 |
non-ASCII character, in case the character can't be displayed in the |
| 184 |
console character set (on many systems, the command line console uses |
| 185 |
a limited character set, such as Latin 1, that can't display the full |
| 186 |
range of Unicode characters that could occur in the source). |
| 187 |
|
| 188 |
(<a href="http://bugdb.tads.org/view.php?id=0000185">bugdb.tads.org #0000185</a>) |
| 189 |
|
| 190 |
|
| 191 |
<li>The IANA time zone database included in the base TADS release has |
| 192 |
been updated to version 2013c (2013-04-20). |
| 193 |
|
| 194 |
<li>On Windows, the interpreter behaved unpredictably (sometimes |
| 195 |
crashing) when certain Date or TimeZone operations were attempted and |
| 196 |
the Windows date/time locale was set to a time zone that uses standard |
| 197 |
time year round (i.e., the time zone doesn't currently make annual |
| 198 |
transitions between standard time and daylight time). This is now |
| 199 |
fixed. (There were actually two separate problems contributing to the |
| 200 |
bug, one specific to Windows and one in the portable code; both are |
| 201 |
fixed.) |
| 202 |
|
| 203 |
(<a href="http://bugdb.tads.org/view.php?id=0000171">bugdb.tads.org #0000171</a>) |
| 204 |
|
| 205 |
<li>In HTTPRequest.sendReply(), automatic content detection of the |
| 206 |
MIME type based on a file's contents didn't work properly for files |
| 207 |
shorter than 512 bytes. This has been fixed. |
| 208 |
|
| 209 |
(<a href="http://bugdb.tads.org/view.php?id=0000187">bugdb.tads.org #0000187</a>) |
| 210 |
|
| 211 |
<li>For Web UI mode, a bug in the HTTPServer class caused the whole |
| 212 |
server to shut down if any individual HTTPServer was terminated, |
| 213 |
either explicitly by calling its shutdown() method, or automatically |
| 214 |
when the object was deleted by the garbage collector. This prevented |
| 215 |
any more messages from being delivered via getNetEvent(), even if |
| 216 |
other server objects were still listening for connections. This |
| 217 |
didn't actually affect most games in practice, because most Web UI |
| 218 |
games create one HTTPServer object that listens for connections |
| 219 |
throughout the server lifetime, but it was still incorrect behavior. |
| 220 |
This has been corrected. |
| 221 |
|
| 222 |
<li>The compiler crashed when presented with a "try" statement with an |
| 223 |
empty "finally" block. This is now fixed. |
| 224 |
|
| 225 |
(<a href="http://bugdb.tads.org/view.php?id=0000176">bugdb.tads.org #0000176</a>) |
| 226 |
|
| 227 |
<li>Starting in version 3.1.0, TADS Workbench didn't run under |
| 228 |
Windows 2000 or earlier versions of Windows, due to a dependency |
| 229 |
on a newer Windows feature that didn't exist until Windows XP SP1. |
| 230 |
The dependency has been removed and replaced with code that should |
| 231 |
work on Win 2K as well as newer systems, so Workbench should once |
| 232 |
again be able to run on Win 2K. |
| 233 |
|
| 234 |
(<a href="http://bugdb.tads.org/view.php?id=0000186">bugdb.tads.org #0000186</a>) |
| 235 |
|
| 236 |
<li>The macro preprocessor incorrectly expanded macros containing |
| 237 |
string embeddings in certain complex cases. In particular, if the |
| 238 |
last macro argument was used within an embedded expression within a |
| 239 |
string within the macro expansion, and another separate embedding |
| 240 |
followed, any subsequent mentions of a macro argument were not |
| 241 |
expanded correctly. The minimal case was something like this: |
| 242 |
|
| 243 |
<pre> |
| 244 |
#define M(a, b) '<<b>><<>>' a |
| 245 |
</pre> |
| 246 |
|
| 247 |
<p>This has been corrected. |
| 248 |
|
| 249 |
(<a href="http://bugdb.tads.org/view.php?id=0000180">bugdb.tads.org #0000180</a>) |
| 250 |
|
| 251 |
</ul> |
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
<h3>Changes for 3.1.2 (August 20, 2012)</h3> |
| 256 |
|
| 257 |
<ul> |
| 258 |
|
| 259 |
<li>New syntax allows defining an object within an expression. This |
| 260 |
type of object is known as an inline object, and is essentially the |
| 261 |
object analog of an anonymous function. Methods of inline objects |
| 262 |
behave like anonymous functions in that they can access locals from |
| 263 |
the enclosing scope. Inline objects are useful for a lot of the same |
| 264 |
coding patterns where anonymous functions are useful, but allow for |
| 265 |
more flexible APIs, since an object is a more general way to express |
| 266 |
context information. The new syntax also has the side benefit of |
| 267 |
letting you define new objects at run-time with the dynamic compiler: |
| 268 |
if you compile and evaluate an expression containing an inline object |
| 269 |
definition, the result will be an instance of the object defined in |
| 270 |
the expression. |
| 271 |
|
| 272 |
<p>For full details, see <a href="sysman/inlineobj.htm">inline objects</a> |
| 273 |
in the System Manual. |
| 274 |
|
| 275 |
<li>The new String method <a href="sysman/string.htm#match">match()</a> |
| 276 |
complements the <a href="sysman/string.htm#find">find()</a> method by |
| 277 |
checking for a match at a given position in the subject string rather |
| 278 |
than searching for a match. |
| 279 |
|
| 280 |
<li><a href="sysman/filename.htm#getFileInfo">FileName.getFileInfo()</a> |
| 281 |
now returns additional information on the file. The new fileAttrs property |
| 282 |
of the FileInfo object provides information on file attributes used on |
| 283 |
some operating systems: the "hidden" and "system" attributes, and whether |
| 284 |
the program has read and/or write access to the file. |
| 285 |
|
| 286 |
<li>The documentation for |
| 287 |
<a |
| 288 |
href="sysman/filename.htm#removeDirectory">FileName.removeDirectory()</a> |
| 289 |
has been changed to specify that the method definitely fails if |
| 290 |
<i>deleteContents</i> is nil and the directory to be removed isn't |
| 291 |
already empty. In the past, the documentation stated that the |
| 292 |
behavior for a non-empty directory varied by platform. In fact, there |
| 293 |
was no variation in practice - all of the existing platforms already |
| 294 |
failed if a directory was non-empty and <i>deleteContents</i> was nil |
| 295 |
- so the warning about variable behavior was just hedging in case any |
| 296 |
future ports didn't work this way. However, the internal porting |
| 297 |
interface that implements directory removal now specifies this exact |
| 298 |
behavior, so there's no longer any need for the hedge. |
| 299 |
|
| 300 |
<li>In the past, when <tt>#pragma once</tt> checked to see if the same |
| 301 |
file had been included previously, it was sensitive to case |
| 302 |
differences in the filenames as written in the #include directives. |
| 303 |
The comparison now uses the local file system conventions; on Windows, |
| 304 |
for example, the comparison ignores case differences. |
| 305 |
|
| 306 |
<li>The IANA time zone database included in the release has been updated |
| 307 |
to version 2012e (2012-08-03). |
| 308 |
|
| 309 |
<li>In 3.1.1, the debugger crashed if a run-time error was thrown by |
| 310 |
a non-Adv3 program. This has been corrected. |
| 311 |
|
| 312 |
(<a href="http://bugdb.tads.org/view.php?id=0000157">bugdb.tads.org #0000157</a>) |
| 313 |
|
| 314 |
<li>The UTF-8 character output mapper produced incorrect output when |
| 315 |
mapping a string that ended with a non-ASCII character. This is |
| 316 |
now fixed. |
| 317 |
|
| 318 |
(<a href="http://bugdb.tads.org/view.php?id=0000159">bugdb.tads.org #0000159</a>) |
| 319 |
|
| 320 |
</ul> |
| 321 |
|
| 322 |
|
| 323 |
<h3>Changes for 3.1.1 (July 14, 2012)</h3> |
| 324 |
|
| 325 |
<ul> |
| 326 |
|
| 327 |
<li>New syntax lets you create constant regular expression values: |
| 328 |
<tt>R"<i>pattern</i>"</tt> and <tt>R'<i>pattern</i>'</tt> are |
| 329 |
equivalent, and define static, pre-compiled RexPattern objects. The |
| 330 |
compiler converts a string of the form <tt>R"..."</tt> or |
| 331 |
<tt>R'...'</tt> into a static RexPattern object, which you can |
| 332 |
then use in any context where a pattern is required. For example: |
| 333 |
|
| 334 |
<pre> local str = 'test string'; |
| 335 |
local title = str.findReplace(R'%<%w', {x: x.toTitleCase()}); |
| 336 |
</pre> |
| 337 |
|
| 338 |
<p>To define a regular expression literal, the R must be capitalized, |
| 339 |
and there must be no spaces between the R and the open quote. "R" |
| 340 |
strings can't use embedded expressions (the << >> syntax). |
| 341 |
The triple-quote syntax can be used with R strings, as in |
| 342 |
<tt>R"""..."""</tt>. |
| 343 |
|
| 344 |
<p>In the past, you could achieve a similar effect by defining a |
| 345 |
static property and setting it to a <tt>new RexPattern()</tt> |
| 346 |
expression. You can still use that approach, of course, but the new |
| 347 |
syntax is more compact and eliminates the need to define an extra |
| 348 |
property just to cache the RexPattern object. Using the new syntax |
| 349 |
also generates slightly more efficient code, since it doesn't require |
| 350 |
a property lookup to retrieve the RexPattern object. (There might be |
| 351 |
other reasons to use the property approach in specific cases, though; |
| 352 |
for example, in a library or extension, defining the pattern via a |
| 353 |
property provides a clean way for users of the module to override the |
| 354 |
pattern if they need to replace it with a customized version.) |
| 355 |
|
| 356 |
<li>The basic integer arithmetic operators (+, -, *, /, and the |
| 357 |
corresponding combination operators such as ++ and +=) now check for |
| 358 |
overflow, and automatically promote the result to BigNumber when an |
| 359 |
overflow occurs. In the past, overflows were simply truncated to fit |
| 360 |
the 32-bit integer type. It was very difficult to detect such cases |
| 361 |
or to do anything sensible with the results; you really had to just be |
| 362 |
careful to avoid overflows, which isn't easy when working with |
| 363 |
external or user-entered data. The new treatment ensures that the |
| 364 |
results of the arithmetic operators will always be arithmetically |
| 365 |
correct, even when they exceed the capacity of the basic integer type. |
| 366 |
This is more in keeping with the TADS philosophy of providing |
| 367 |
a high-level environment where you don't have to worry about |
| 368 |
hardware-level details such as how many bits can be stored in an |
| 369 |
integer. |
| 370 |
|
| 371 |
<p>This change should be transparent to existing programs, since (a) |
| 372 |
BigNumbers can for the most part be used interchangeably with |
| 373 |
integers, and (b) any program that encountered an integer overflow in |
| 374 |
the past probably misbehaved when it did, since there was no good way |
| 375 |
to detect or handle overflows. The effect on most existing programs |
| 376 |
should thus be to allow them to correctly handle a wider range of |
| 377 |
inputs. In some cases, the effect will be to flag a run-time error |
| 378 |
for a case where a value really does have to fit in an integer, where |
| 379 |
in the past the code would have failed somewhat more mysteriously due |
| 380 |
to the truncated arithmetic result. The new handling should be an |
| 381 |
improvement even in error cases, since the source of the error will |
| 382 |
be more immediately apparent than in the past. |
| 383 |
|
| 384 |
<p>There's a slight impact on execution speed because of the extra |
| 385 |
checks required for arithmetic operations, although typical TADS |
| 386 |
programs aren't arithmetically intensive enough to notice any |
| 387 |
difference. What's more, the VM-level checking eliminates the need |
| 388 |
for extra program code to do bounds checking, so this could end up |
| 389 |
being a performance enhancement in situations where overflows are a |
| 390 |
concern. |
| 391 |
|
| 392 |
<li>The compiler now automatically promotes any integer constant value |
| 393 |
that overflows the ordinary integer type to BigNumber. This applies |
| 394 |
to values that are explicitly stated (e.g., "x = 3000000000;") as well |
| 395 |
as to constant expressions (e.g., "x = 1000000000 * 3;"). The |
| 396 |
compiler shows a warning message each time it applies such a |
| 397 |
promotion; BigNumber values aren't necessarily allowed in all contexts |
| 398 |
where integers are normally used, such as for some built-in function |
| 399 |
and method arguments, so the compiler wants you to be aware when it |
| 400 |
substitutes a BigNumber for a value you stated as an integer. You can |
| 401 |
remove the warning on a case-by-case basis by explicitly stating the |
| 402 |
value as a BigNumber constant in the first place, by including a |
| 403 |
decimal point in the number (e.g., "x = 3000000000.;"). |
| 404 |
|
| 405 |
<p>Integers specified in hex or octal notation (e.g., 0x80000000 or |
| 406 |
040000000000) aren't promoted if they can fit within a 32-bit |
| 407 |
<i>unsigned</i> integer. Hex and octal are frequently used to enter |
| 408 |
numbers with specific bit patterns, so the compiler assumes that's |
| 409 |
your intention with these formats. A hex or octal number that's over |
| 410 |
the 32-bit unsigned limit of 4294967295 will be promoted, though, |
| 411 |
since there's no way to store such a large value in a 32-bit integer |
| 412 |
regardless of its signedness. |
| 413 |
|
| 414 |
<li>The compiler now pre-calculates the results of arithmetic |
| 415 |
expressions involving BigNumber constant values. (This is known |
| 416 |
as "constant folding".) If an expression contains only constant |
| 417 |
numeric values, with any combination of integers and BigNumber values, |
| 418 |
the compiler will pre-calculate the results for the ordinary |
| 419 |
arithmetic operators (+ - * / %) and the comparison operators (== != |
| 420 |
< > <= >=). In the past, the compiler deferred |
| 421 |
calculations involving BigNumber values until run-time; constant |
| 422 |
folding improves the execution speed of affected expressions for |
| 423 |
obvious reasons. |
| 424 |
|
| 425 |
<li>You can now use <a href="sysman/tadsgen.htm#sprintf">sprintf</a> |
| 426 |
format codes directly within embedded expressions. To do this, start |
| 427 |
the expression with a "%" code immediately after the angle brackets, |
| 428 |
with no intervening spaces. For example, <tt>"x in octal is |
| 429 |
<<%o x>>"</tt> will display <i>x</i>'s contents in octal |
| 430 |
(base 8). The compiler simply converts this sort of expression into a |
| 431 |
sprintf() call with the given format code, so you can use the entire |
| 432 |
range of format code syntax that sprintf() accepts. |
| 433 |
|
| 434 |
<li>The new <a href="sysman/tadsgen.htm#sprintf">sprintf</a> format |
| 435 |
codes %r and %R generate Roman numerals for integer values, in lower- |
| 436 |
and upper-case. |
| 437 |
|
| 438 |
<li>The String methods <a href="sysman/string.htm#find">find()</a> and |
| 439 |
<a href="sysman/string.htm#findReplace">findReplace()</a> now accept a |
| 440 |
RexPattern object as the search target. An ordinary string can also |
| 441 |
still be used, of course. This essentially makes String.find() and |
| 442 |
String.findReplace() replicate the functionality of |
| 443 |
<a href="sysman/tadsgen.htm#rexSearch">rexSearch()</a> and |
| 444 |
<a href="sysman/tadsgen.htm#rexReplace">rexReplace()</a>, |
| 445 |
respectively; the main benefit is that the syntax for the String |
| 446 |
methods is a little cleaner and more intuitive, since the subject |
| 447 |
string is moved out of the parameter list. |
| 448 |
|
| 449 |
<p>This is especially convenient with the new <tt>R'...'</tt> syntax |
| 450 |
for creating static RexPattern objects. For example, |
| 451 |
<tt>str.find(R'%w+')</tt> finds the first word in a string. |
| 452 |
|
| 453 |
<li>The String method |
| 454 |
<a href="sysman/string.htm#findReplace">findReplace()</a> and the |
| 455 |
<a href="sysman/tadsgen.htm#rexReplace">rexReplace()</a> function each |
| 456 |
now take an optional additional argument, <i>limit</i>, specifying the |
| 457 |
maximum number of replacements to perform. If the <i>limit</i> |
| 458 |
argument is omitted, the ReplaceOnce and ReplaceAll flags determine |
| 459 |
the limit; if <i>limit</i> is included in the arguments, the |
| 460 |
ReplaceOnce and ReplaceAll flags are ignored, and the <i>limit</i> |
| 461 |
value takes precedence. <i>limit</i> can be nil to specify that all |
| 462 |
occurrences are to be replaced, or an integer to set a limit count. |
| 463 |
Zero means that no replacements are performed, in which case |
| 464 |
the original subject string is returned unchanged. |
| 465 |
|
| 466 |
<li>The new String function |
| 467 |
<a href="sysman/string.htm#findAll">findAll()</a> searches a string |
| 468 |
for all occurrences of a given substring or regular expression, and |
| 469 |
returns a list of the matches. |
| 470 |
|
| 471 |
<li>Two new functions implement reverse searches in strings: |
| 472 |
<a href="sysman/tadsgen.htm#rexSearchLast">rexSearchLast()</a> and |
| 473 |
<a href="sysman/string.htm#findLast">String.findLast()</a> These |
| 474 |
functions search a string from right to left, allowing you to find the |
| 475 |
last (rightmost) match for a substring or regular expression pattern. |
| 476 |
|
| 477 |
<li>The <a href="sysman/tadsgen.htm#rexGroup">rexGroup()</a> function |
| 478 |
can now be used to get information on the entire match, by passing 0 |
| 479 |
for the group number. rexGroup(0) returns the same format as the |
| 480 |
other groups, but contains the text and location of the entire match |
| 481 |
rather than of a parenthesized group within the match. |
| 482 |
|
| 483 |
<li>TADS now has more complete support for Unicode case conversions. |
| 484 |
Unicode defines two levels of case conversions; the older, simpler |
| 485 |
level provides one-to-one character mappings between upper- and |
| 486 |
lower-case letters, while the newer level allows for characters that |
| 487 |
expand into multiple replacement characters when converting case. The |
| 488 |
canonical example is the German sharp S character, ß, which |
| 489 |
changes to "SS" when capitalized - there's no such thing as a capital |
| 490 |
sharp S in standard German typography. For proper case conversion of |
| 491 |
a string containing an ß, then, each ß character expands to |
| 492 |
the two-character sequence "SS". There are similar examples in other |
| 493 |
languages, some involving other ligatures and some involving accented |
| 494 |
characters that don't have upper-case equivalents. |
| 495 |
|
| 496 |
<p>In past versions of TADS, only the one-to-one conversions were |
| 497 |
supported. Characters such as ß that required more complex |
| 498 |
handling were generally left unchanged in case conversions. TADS now |
| 499 |
supports the full one-to-N mappings. This won't affect most text, |
| 500 |
since most characters have simple single-character replacements when |
| 501 |
converting in upper or lower case. |
| 502 |
|
| 503 |
<p>TADS also now supports Unicode "case folding", which is a separate |
| 504 |
mapping for case-insensitive string comparisons. In the past, TADS |
| 505 |
generally approached case-insensitive comparisons by converting each |
| 506 |
character to be compared to a common case (upper or lower), according |
| 507 |
to which character was the "reference" character in the comparison. |
| 508 |
Now, TADS uses the Unicode case folding tables instead, and converts |
| 509 |
each character to its "folded" form for comparison. The folded form |
| 510 |
of each character is defined individually in the Unicode character |
| 511 |
database tables, but in nearly all cases it's the same as converting |
| 512 |
the character to upper case and then back to lower case. |
| 513 |
|
| 514 |
<p>The new case conversion and case-folding support affects several areas: |
| 515 |
|
| 516 |
<ul> |
| 517 |
|
| 518 |
<li><a href="sysman/regex.htm">Regular expressions</a>: when the |
| 519 |
<nocase> flag is specified, the matcher uses case folding to |
| 520 |
match each contiguous string of literals. (In past versions, |
| 521 |
characters were compared by converting to the pattern character's |
| 522 |
case using the one-to-one conversions only.) |
| 523 |
|
| 524 |
<li>The String methods |
| 525 |
<a href="sysman/string.htm#toUpper">toUpper()</a> and |
| 526 |
<a href="sysman/string.htm#toLower">toLower()</a> use the new |
| 527 |
case conversion tables. In the past, these used the older |
| 528 |
one-to-one case conversion tables. |
| 529 |
|
| 530 |
<li>The new String methods |
| 531 |
<a href="sysman/string.htm#toTitleCase">toTitleCase()</a> and |
| 532 |
<a href="sysman/string.htm#toFoldedCase">toFoldedCase()</a> |
| 533 |
use the new tables. |
| 534 |
|
| 535 |
<li>The new String method |
| 536 |
<a href="sysman/string.htm#compareIgnoreCase">compareIgnoreCase()</a> |
| 537 |
uses the full case folding tables to perform a case-insensitive |
| 538 |
comparison. |
| 539 |
|
| 540 |
<li>The <a href="sysman/strcomp.htm">StringComparator</a> class |
| 541 |
now uses full case folding when the comparator isn't case-sensitive. |
| 542 |
In the past, caseless comparisons were done by converting each |
| 543 |
input character to match the case of the corresponding dictionary |
| 544 |
character, using the one-to-one conversions only. |
| 545 |
|
| 546 |
</ul> |
| 547 |
|
| 548 |
<p>The new support only includes the unconditional case mappings. The |
| 549 |
Unicode tables define a number of case mappings that are conditional, |
| 550 |
some on the language in use and some on string context. TADS doesn't |
| 551 |
currently support any of the conditional mappings. |
| 552 |
|
| 553 |
<li>The new String method |
| 554 |
<a href="sysman/string.htm#toTitleCase">toTitleCase()</a> converts |
| 555 |
each character in the string to "title case". This is the same as |
| 556 |
upper case for most characters, but varies for some characters. For |
| 557 |
example, a character representing a ligature (e.g., the 'ffi' ligature |
| 558 |
character, U+FB03) is converted to the corresponding series of |
| 559 |
separate letters with only the first letter capitalized (so U+FB03 |
| 560 |
becomes the three separate letters F, f, i). |
| 561 |
|
| 562 |
<li>The new String method |
| 563 |
<a href="sysman/string.htm#toFoldedCase">toFoldedCase()</a> converts |
| 564 |
each character in the string to its case-folded equivalent, as defined |
| 565 |
in the Unicode standard. The point of case folding is to erase case |
| 566 |
differences between strings, to allow for case-insensitive |
| 567 |
comparisons. For most strings, the case-folded version is the same as |
| 568 |
the lower-case version, although not always; characters that don't |
| 569 |
have exact equivalents in the opposite case (e.g., the German sharp S, |
| 570 |
ß) are generally handled as though they were first mapped to upper |
| 571 |
case and then back to lower, so the result will sometimes expand one |
| 572 |
character to two or more characters in the folded version (e.g., ß |
| 573 |
turns into ss, so that 'WEISS' will match 'weiß' in a case-insensitive |
| 574 |
comparison). |
| 575 |
|
| 576 |
<li>The new String method |
| 577 |
<a href="sysman/string.htm#compareTo">compareTo()</a> compares the |
| 578 |
target string to another string, returning a negative number if the |
| 579 |
target string sorts before the second string, 0 if they're identical, |
| 580 |
or a positive number i the target string sorts after the other string. |
| 581 |
C/C++ programmers will recognize this as the standard strcmp() |
| 582 |
behavior. You can get the same information using comparison |
| 583 |
operators, but compareTo() is more efficient for things like sorting |
| 584 |
callbacks because it determines the relative order in one operation. |
| 585 |
For example: |
| 586 |
|
| 587 |
<p> |
| 588 |
<pre> |
| 589 |
lst = lst.sort(SortAsc, {a, b: a < b ? -1 : a > b ? 1 : 0}); |
| 590 |
lst = lst.sort(SortAsc, {a, b: a.compareTo(b)}); |
| 591 |
</pre> |
| 592 |
|
| 593 |
<p>The two callbacks have the same effect, but the second is a little |
| 594 |
more efficient, since it always does just one string comparison per |
| 595 |
callback invocation. |
| 596 |
|
| 597 |
<li>The new String method |
| 598 |
<a href="sysman/string.htm#compareIgnoreCase">compareIgnoreCase()</a> |
| 599 |
compares the target string to another string, using the case-folded |
| 600 |
version of each string. It returns the same type of result as |
| 601 |
compareTo() - negative if the target string sorts before the other |
| 602 |
string, zero if they're equal, and positive if the target sorts after |
| 603 |
the other string, in all cases ignoring case differences. This is |
| 604 |
equivalent to calling compareTo() using the results of calling |
| 605 |
toFoldedCase() on each string, but compareIgnoreCase() is more |
| 606 |
efficient since it never constructs the full case-folded versions of |
| 607 |
the two strings (it does the case folding character by character as it |
| 608 |
compares the strings). |
| 609 |
|
| 610 |
<li>The new function <a href="sysman/tadsgen.htm#concat">concat()</a> |
| 611 |
returns a string with the concatenation of the argument values. This |
| 612 |
is essentially the same as using the "+" operator to concatenate a |
| 613 |
series of strings, but it's more efficient when combining three or |
| 614 |
more values, since the "+" operator is applied successively in |
| 615 |
pairs and so has to build and copy an intermediate result string at |
| 616 |
each step. |
| 617 |
|
| 618 |
<li>The new function <a href="sysman/tadsgen.htm#abs">abs()</a> |
| 619 |
returns the absolute value of an integer or BigNumber value. |
| 620 |
|
| 621 |
<li>The new function <a href="sysman/tadsgen.htm#sgn">sgn()</a> |
| 622 |
returns the SGN (sign) of an integer or BigNumber value. The SGN is 1 |
| 623 |
for a positive argument, 0 for zero, and -1 for a negative argument. |
| 624 |
|
| 625 |
<li>The new t3make option -FC automatically creates the project's |
| 626 |
output directories. If this option is specified, the compiler creates |
| 627 |
the directories specified in the -Fy, -Fs, and -o options, if they |
| 628 |
don't already exist. This makes it simpler to move a project to a new |
| 629 |
directory or onto a new machine, since -FC makes it unnecessary to |
| 630 |
create the output directories manually. |
| 631 |
|
| 632 |
<li>HTTPRequest now recognizes GIF image files when sending a reply |
| 633 |
body. When the caller lets HTTPRequest auto-detect the MIME type in |
| 634 |
sendReply() and related methods, the class will now use "image/gif" |
| 635 |
when it detects a GIF file. As with other binary file types, the |
| 636 |
class recognizes GIF files by looking for the format's standard |
| 637 |
signature near the start of the reply body data. |
| 638 |
|
| 639 |
(<a href="http://bugdb.tads.org/view.php?id=0000139">bugdb.tads.org #0000139</a>) |
| 640 |
|
| 641 |
<li>The new <a href="sysman/httpreq.htm">HTTPRequest</a> method |
| 642 |
<a href="sysman/httpreq.htm#sendReplyAsync">sendReplyAsync()</a> lets |
| 643 |
you send the reply to an HTTP request asynchronously, in a background |
| 644 |
thread, so that the main program thread can continue to service other |
| 645 |
requests while the reply is sent. This is useful when the reply |
| 646 |
contains a large content body, such as a large image or audio file. |
| 647 |
Most browsers use background threads on the client side to download |
| 648 |
large media objects, so that the UI remains responsive to user input |
| 649 |
while the objects are downloaded; with the TADS Web UI, this means |
| 650 |
that the browser can generate new XML requests while image or audio |
| 651 |
downloads are still in progress. The HTTPRequest sendReply() method |
| 652 |
is synchronous, meaning that it doesn't return until the entire data |
| 653 |
transfer has been completed. This means that the program can't |
| 654 |
service any new XML requests that the browser sends during the |
| 655 |
download until after the download has completed and sendReply() |
| 656 |
returns, which makes the UI unresponsive for the duration of the |
| 657 |
download. sendReplyAsync() addresses this by letting you initiate a |
| 658 |
reply and then immediately return to servicing other requests, without |
| 659 |
waiting for the reply data transfer to finish. |
| 660 |
|
| 661 |
<p>The Web UI library uses the new method to send replies to requests |
| 662 |
for resource files, since these files are often images, sounds, and |
| 663 |
other media objects that can be large enough to take noticeable time |
| 664 |
to transfer across a network. Resource files are the mechanism that |
| 665 |
most games use to handle their HTML media objects, so most game |
| 666 |
authors shouldn't have to use sendReplyAsync() directly. |
| 667 |
|
| 668 |
<li>The new class <a href="sysman/filename.htm">FileName</a> provides |
| 669 |
a portable way to manipulate file names and directory paths, and |
| 670 |
methods to operate on the corresponding file system objects named. |
| 671 |
Each operating system has its own file path syntax, so it's always |
| 672 |
been difficult to use ordinary strings to construct and parse |
| 673 |
filenames that involve directory paths. It's too easy to make |
| 674 |
assumptions that tie the program to a single operating system; the |
| 675 |
alternative has been to write a bunch of special-case code to handle |
| 676 |
the syntax for each OS that you want to support. The FileName class |
| 677 |
helps by providing methods for common filename construction and |
| 678 |
parsing operations, which are implemented appropriately for each |
| 679 |
operating system where TADS runs. TADS has always had many of these |
| 680 |
portability functions internally for its own use, mainly for the |
| 681 |
compiler and other tools; the FileName class makes them available to |
| 682 |
TADS programs. These new features will probably be of little direct |
| 683 |
interest to game authors, but could be useful to library and tool |
| 684 |
developers. |
| 685 |
|
| 686 |
<p>In addition to building and parsing filenames, FileName |
| 687 |
provides access to a much more complete set of file system functions |
| 688 |
than was previously available. The new class lets you create and |
| 689 |
delete directories, list directory contents, retrieve file system |
| 690 |
metadata (file sizes, types, modification dates), and move and |
| 691 |
rename files. As with the previously existing file access functions, |
| 692 |
the new functions are subject to the file safety restrictions to |
| 693 |
reduce the risk of malicious use and give the user control over |
| 694 |
the scope of a program's file system access. |
| 695 |
|
| 696 |
<li>The <a href="sysman/tadsio.htm#inputFile">inputFile()</a> function |
| 697 |
now returns a <a href="sysman/filename.htm">FileName</a> object to |
| 698 |
represent the file chosen by the user, rather than a string. Existing |
| 699 |
code shouldn't be affected unless it's unusually dependent upon the |
| 700 |
result being a string, since the FileName object can be passed to any |
| 701 |
of the functions that open files (including the File.openXxx methods, |
| 702 |
saveGame(), etc) in place of a string, and is automatically |
| 703 |
converted to a string containing the file name in most contexts |
| 704 |
where a string is required. |
| 705 |
|
| 706 |
<p>A FileName returned by inputFile() has an internal attribute that |
| 707 |
marks it as a user selection, which grants special permission to use |
| 708 |
the file even if it wouldn't normally be accessible under the file |
| 709 |
safety settings. A manual selection via an inputFile() dialog |
| 710 |
overrides the safety settings because of the user's direct |
| 711 |
involvement; the user directly expresses an intention to use the file |
| 712 |
in the manner proposed by the dialog, which is an implicit grant of |
| 713 |
permission. |
| 714 |
|
| 715 |
<li>Several of the system-level functions that access files are now |
| 716 |
subject to file safety restrictions: |
| 717 |
<a href="sysman/tadsgen.htm#saveGame">saveGame()</a>, |
| 718 |
<a href="sysman/tadsgen.htm#restoreGame">restoreGame()</a>, |
| 719 |
<a href="sysman/tadsio.htm#setLogFile">setLogFile()</a>, |
| 720 |
<a href="sysman/tadsio.htm#setLogFile">setScriptFile()</a>, and |
| 721 |
<a href="sysman/tadsio.htm#logConsoleCreate">logConsoleCreate()</a> |
| 722 |
now enforce the appropriate read or write permissions according to the |
| 723 |
file safety settings. |
| 724 |
|
| 725 |
<p>In the past, these functions didn't enforce file safety settings, |
| 726 |
mostly for practical reasons: these functions are all used by the Adv3 |
| 727 |
library to operate on files that are normally selected by the user, so |
| 728 |
it would have been confusing to deny access in cases where the user |
| 729 |
happened to choose a file outside the sandbox. This was balanced |
| 730 |
against the lower inherent risk with these functions, as compared to |
| 731 |
the general-purpose File methods. The game program can't use these |
| 732 |
functions for arbitrary read/write operations; the actual data content |
| 733 |
they read/write is largely under the control of the system, so there's |
| 734 |
probably no way to use them to do something like planting a virus or |
| 735 |
stealing private data. However, since some of them create new files, |
| 736 |
they could still be used for certain types of mischief, such as |
| 737 |
overwriting system files or destroying user data. |
| 738 |
|
| 739 |
<p>The thing that's changed - that allows us to bring these functions |
| 740 |
into the file safety mechanism - is the new ability of |
| 741 |
<a href="sysman/tadsio.htm#inputFile">inputFile()</a> to mark its |
| 742 |
filename result as coming from a manual user selection, and the |
| 743 |
corresponding file safety enhancement that grants access permissions |
| 744 |
to such manually selected files. This ensures that user file |
| 745 |
selections for Save, Restore, etc. will still work properly, even when |
| 746 |
they're outside the sandbox. |
| 747 |
|
| 748 |
<li>The new <a href="sysman/date.htm">Date</a> built-in class provides |
| 749 |
extensive functionality for parsing, formatting, and doing arithmetic |
| 750 |
with calendar dates and times; it works with the new |
| 751 |
<a href="sysman/timezone.htm">TimeZone</a> class to convert between |
| 752 |
universal time and local time anywhere in the world, correctly |
| 753 |
accounting for historical changes in time zone definitions and |
| 754 |
daylight savings time. This should be especially useful to authors |
| 755 |
writing games involving time travel, or set during the early morning |
| 756 |
hours on certain Sundays in March or November. |
| 757 |
|
| 758 |
<li>The new function <a href="sysman/tadsgen.htm#makeList">makeList()</a> |
| 759 |
constructs a list consisting of a repeated value. |
| 760 |
|
| 761 |
<li>The system library's main startup code (in lib/_main.t) now allows |
| 762 |
the main() function to omit the argument list parameter. The library |
| 763 |
now simply calls main() with as many arguments as it requires, |
| 764 |
providing the standard "args" parameter if needed and otherwise |
| 765 |
omitting it. For little stand-alone programs that don't use the Adv3 |
| 766 |
library, this simplifies the code a little by letting you omit the |
| 767 |
argument list parameter if you don't need it. |
| 768 |
|
| 769 |
<li>Lists and vectors can now be converted to strings, explicitly with |
| 770 |
<a href="sysman/tadsgen.htm#toString">toString()</a> as well as in |
| 771 |
contexts where non-string values are automatically coerced to strings, |
| 772 |
such as on the right-hand side of a "+" operator where the left-hand |
| 773 |
side is a string value. The string representation of a list or vector |
| 774 |
is the concatenation of its elements, each first converted to a string |
| 775 |
itself if necessary, with commas separating elements. For example, |
| 776 |
toString([1, 2, 3]) is the string '1,2,3'. |
| 777 |
|
| 778 |
<li>In implicit string conversions, the value <tt>true</tt> is now |
| 779 |
acceptable, and is converted to the string 'true'. In the past, |
| 780 |
<tt>true</tt> worked this way with the |
| 781 |
<a href="sysman/tadsgen.htm#toString">toString</a> function, but not |
| 782 |
in implicit string conversions (such as when a value is used on the |
| 783 |
right-hand side of a "+" operator when the left-hand side is a |
| 784 |
string: <tt>'x=' + true</tt> caused a run-time error in the past, |
| 785 |
but now returns 'x=true'). |
| 786 |
|
| 787 |
<li>The <a href="sysman/tadsgen.htm#toString">toString</a> function |
| 788 |
and implicit string conversions now accept properties, function |
| 789 |
pointers, pointers to built-in functions, and enum values. If the |
| 790 |
reflection services module (reflect.t) is included in the build, these |
| 791 |
types will be passed to reflectionServices.valToSymbol() so that they |
| 792 |
can be translated to symbols when possible. If reflect.t isn't |
| 793 |
included in the build, or if valToSymbol() doesn't return a string |
| 794 |
value, these types will be represented using a default format that |
| 795 |
indicates the value's type and an internal numeric identifier for the |
| 796 |
value, such as "property#23" or "enum#17". Any object type that |
| 797 |
doesn't have a specialized string conversion defined by the built-in |
| 798 |
object type is now handled the same way, so an object without special |
| 799 |
formatting is represented either by its symbolic name (if it has one |
| 800 |
and reflect.t is included in the build) or a generic "object#" format. |
| 801 |
|
| 802 |
<li>The List method <a href="sysman/list.htm#sublist">sublist()</a> |
| 803 |
now accepts negative <i>length</i> values, for better consistency with |
| 804 |
similar methods (e.g., String.substr). A negative length essentially |
| 805 |
states the length relative to the end of the list, in that it gives |
| 806 |
the number of elements to omit from the end of the result list. |
| 807 |
|
| 808 |
<li>The <a href="sysman/pack.htm">byte packing language</a> now lets |
| 809 |
you specify that a square-bracketed group is to be packed |
| 810 |
from/unpacked into subgroups per iteration for a repeated item, rather |
| 811 |
than using a single sublist for the whole group. The "!" modifier |
| 812 |
makes this change. For example, <tt>fp.unpackBytes('[L S C]5!')</tt> |
| 813 |
returns (when successful) a list containing five sublists, each of |
| 814 |
which contains the three unpacked elements from one group iteration (a |
| 815 |
long int, a short int, and an 8-bit int). |
| 816 |
|
| 817 |
<li>The byte packer now allows up-to counts (e.g., 'a10*') for packing |
| 818 |
(not just unpacking). When packing, for a group or a non-string item, |
| 819 |
an up-to count packs up to the numeric limit, or up to the actual |
| 820 |
number of arguments; for a string, an up-to count packs up to the |
| 821 |
actual string length or up to the limit, truncating the string at the |
| 822 |
limit if it's longer. |
| 823 |
|
| 824 |
<li>The regular expression language accepts several new shorthand |
| 825 |
character classes: %s for a space character, %S for a non-space |
| 826 |
character, %d for a digit, %D for a non-digit, %v for a vertical |
| 827 |
space, %V for a non vertical space. (These correspond to backslash |
| 828 |
sequences - \s, \D, etc - that are fairly standard these days in other |
| 829 |
languages with regex parsers, such as Javascript and php. There were |
| 830 |
already <xxx> character classes that do the same things as these |
| 831 |
new % codes, but these particular classes tend to be used often enough |
| 832 |
that it's nice to have shorthand versions.) |
| 833 |
|
| 834 |
<li>The new <a href="sysman/expr.htm#__objref">__objref()</a> operator |
| 835 |
lets you test for the existence of a particular object symbol, |
| 836 |
optionally generating a warning or error message if the symbol isn't |
| 837 |
defined or is defined as something other than an object. This is |
| 838 |
similar to the <a href="sysman/expr.htm#defined">defined()</a> |
| 839 |
operator, but is specialized for object references. |
| 840 |
|
| 841 |
<li>The <a href="sysman/tadsgen.htm#randomize">randomize()</a> |
| 842 |
built-in function can do several new tricks. First, it allows you to |
| 843 |
select from three different RNG algorithms to use in |
| 844 |
<a href="sysman/tadsgen.htm#rand">rand()</a>: the default ISAAC |
| 845 |
algorithm (the original TADS 3 RNG), a Linear Congruential Generator |
| 846 |
(or LCG, the long-time de facto standard for computer RNGs), and the |
| 847 |
Mersenne Twister (a newer algorithm that's become popular in other |
| 848 |
modern interpreted languages). ISAAC is still a good general-purpose |
| 849 |
choice, but the new options are there in case you have some reason to |
| 850 |
prefer the properties of one of the other generators. Second, you can |
| 851 |
now set a fixed seed value. This allows you to override the automatic |
| 852 |
startup randomization that was added in TADS 3.1, and further lets you |
| 853 |
start a new fixed sequence at any time. Third, you can now save and |
| 854 |
restore the state of the RNG, so that you can make the RNG repeat the |
| 855 |
same sequence of results it produced from the time of the saved state. |
| 856 |
|
| 857 |
<li>When the interpreter is launched, any command-line arguments that |
| 858 |
follow the .t3 file name are passed to the program as string arguments |
| 859 |
to the main() function. In the past, these arguments were passed as-is, |
| 860 |
without any character set translation, which caused unpredictable |
| 861 |
results if they contained any non-ASCII characters. The interpreter |
| 862 |
now translates these strings from the local character set to Unicode, |
| 863 |
ensuring that any accented letters or other non-ASCII characters are |
| 864 |
interpreted properly. |
| 865 |
|
| 866 |
(Related to <a href="http://bugdb.tads.org/view.php?id=0000109">bugdb.tads.org #0000109</a>) |
| 867 |
|
| 868 |
|
| 869 |
<li>The new interpreter command-line option |
| 870 |
<a href="sysman/terp.htm#-d-option">-d</a> specifies the default |
| 871 |
directory for file input/output. This is the directory that the File |
| 872 |
object uses to open files whose names are specified with relative |
| 873 |
paths. If -d isn't specified, the default is the folder containing |
| 874 |
the .t3 file. (In past versions, there wasn't any way to set the |
| 875 |
working directory, which was always the .t3 file's folder. This means |
| 876 |
the behavior in the absence of a -d option is the same as in the past.) |
| 877 |
|
| 878 |
<p>The new option <a href="sysman/terp.htm#-sd-option">-sd</a> lets |
| 879 |
you separately specify the "sandbox" directory for the file safety |
| 880 |
feature. In the absence of an -sd setting, the sandbox directory is |
| 881 |
the same as -d setting, or simply the .t3 file's containing folder if |
| 882 |
there's no -d option. |
| 883 |
|
| 884 |
<p>(The -d option was added in part to address |
| 885 |
<a href="http://bugdb.tads.org/view.php?id=0000120">bugdb.tads.org #0000120</a>) |
| 886 |
|
| 887 |
|
| 888 |
<li>A bug in the dynamic compiler caused 'if' statements in |
| 889 |
dynamically compiled code (e.g., using <tt>new DynamicFunc()</tt>) to |
| 890 |
use the 'then' branch code for both true and false outcomes. This has |
| 891 |
been fixed. |
| 892 |
|
| 893 |
(<a href="http://bugdb.tads.org/view.php?id=0000117">bugdb.tads.org #0000117</a>) |
| 894 |
|
| 895 |
<li>A bug in the dynamic compiler sometimes caused a run-time error when |
| 896 |
accessing a local variable when the enclosing function also defined an |
| 897 |
anonymous function. This is now fixed. |
| 898 |
|
| 899 |
(<a href="http://bugdb.tads.org/view.php?id=0000118">bugdb.tads.org #0000118</a>) |
| 900 |
|
| 901 |
<li>A bug in the BigNumber class sporadically gave incorrect results |
| 902 |
for additions. (Specifically, results were sporadically off by one in |
| 903 |
the last digit.) This has been corrected. |
| 904 |
|
| 905 |
<li>toInteger() caused a crash when used with values below 0.1. This |
| 906 |
has been corrected. |
| 907 |
|
| 908 |
(<a href="http://bugdb.tads.org/view.php?id=0000127">bugdb.tads.org #0000127</a>) |
| 909 |
|
| 910 |
<li>The compiler reported an unhelpful internal error message |
| 911 |
("unsplicing invalid line") if a file ended in an unterminated string |
| 912 |
literal. The message is now the more explanatory "unterminated string |
| 913 |
literal". |
| 914 |
|
| 915 |
<li>Consider this macro definition and usage: |
| 916 |
|
| 917 |
<p><pre> |
| 918 |
#define ERROR(msg) tadsSay(#@msg) |
| 919 |
ERROR({) |
| 920 |
</pre> |
| 921 |
|
| 922 |
<p>In the past, the compiler treated the ERROR({) line as have a |
| 923 |
missing close paren. This is because the compiler previously tried to |
| 924 |
balance open and close curly braces and square brackets within macro |
| 925 |
arguments, and treated any parentheses found nested within |
| 926 |
braces or brackets as being part of the macro argument, rather than |
| 927 |
terminating the macro argument. This no longer occurs; parentheses |
| 928 |
are now treated independently of braces and brackets within macro |
| 929 |
arguments, so a close paren within a macro argument that doesn't match |
| 930 |
an earlier open paren in the same argument now ends the argument. The |
| 931 |
example above thus now compiles without error, and expands to |
| 932 |
<tt>tadsSay('{')</tt>. The balancing act for braces and brackets does |
| 933 |
still apply to commas, though: a comma within a pair of braces or |
| 934 |
brackets is still considered part of the argument. This is important |
| 935 |
for macro arguments that contain things like statement blocks or |
| 936 |
anonymous function definitions. |
| 937 |
|
| 938 |
<li>The File unpackBytes() method incorrectly threw an error if an |
| 939 |
"up-to" format was used (e.g., 'H20*') and the file had zero bytes |
| 940 |
left to read. This has been corrected; unpackBytes() now succeeds |
| 941 |
and returns a zero-length result for the format item. |
| 942 |
|
| 943 |
<li>String.split() incorrectly returned a one-element list (consisting |
| 944 |
of an empty string) when used on an empty string. This now correctly |
| 945 |
returns an empty list. |
| 946 |
|
| 947 |
<li>A bug in String.split() caused sporadic crashes when splitting |
| 948 |
at a delimiter and the result list had more than 10 elements. The |
| 949 |
bug was related to garbage collection timing, so it was unpredictable. |
| 950 |
This is now fixed. |
| 951 |
|
| 952 |
(<a href="http://bugdb.tads.org/view.php?id=0000156">bugdb.tads.org #0000156</a>) |
| 953 |
|
| 954 |
<li>A bug introduced in 3.1.0 caused exceptions to be caught in the |
| 955 |
wrong handlers under certain rare conditions. The problem happened |
| 956 |
with exceptions thrown from within method calls when the caller had a |
| 957 |
new "try" block starting immediately after the expression containing |
| 958 |
the method call, with no other VM instructions between the call and |
| 959 |
the start of the "try" block (this means, for example, that the return |
| 960 |
value from the method call was discarded and no other computations |
| 961 |
were performed as part of the same expression after the method call). |
| 962 |
When all of these conditions were met, the exception was incorrectly |
| 963 |
handled by the "catch" part of the "try" block that started just after |
| 964 |
the call; this was incorrect because the "try" block didn't contain |
| 965 |
the call and so its "catch" block shouldn't have been involved in |
| 966 |
handling an exception that occurred within the call. The correct |
| 967 |
behavior has been restored. |
| 968 |
|
| 969 |
<li>A bug in the regular expression parser randomly caused bad |
| 970 |
behavior, including crashes, if the last character of an expression |
| 971 |
string was outside of the ASCII range (Unicode code points 0 to 127). |
| 972 |
The bug was only triggered when certain byte values happened to follow |
| 973 |
the string in memory, so it only showed up rarely even for expression |
| 974 |
strings matching the description. (It was also possible to trigger |
| 975 |
the same bug with a non-ASCII character within five characters of the |
| 976 |
last position if the string ended with an incomplete <Xxx> |
| 977 |
character class name, lacking the final ">", but this might have |
| 978 |
been too improbable to have ever been observed in the wild.) This has |
| 979 |
been fixed. |
| 980 |
|
| 981 |
<li>A compiler bug introduced in 3.1.0 made it impossible to assign |
| 982 |
to an indexed "self" element in a modifier method for an intrinsic |
| 983 |
class such as List or Vector. This has been corrected. |
| 984 |
|
| 985 |
(<a href="http://bugdb.tads.org/view.php?id=0000128">bugdb.tads.org #0000128</a>) |
| 986 |
|
| 987 |
<li>In the past, the compiler attempted to pre-evaluate any indexing |
| 988 |
expression it encountered ("a[b]") where the index value and the value |
| 989 |
being indexed were both constants. In such cases, it only recognized |
| 990 |
list indexing, which was the only valid constant indexing expression |
| 991 |
before operator overloading made it possible to define indexing on |
| 992 |
custom object classes. This made the compiler generate error messages |
| 993 |
for (potentially) valid code involving constant index values applied |
| 994 |
to object names. This has been corrected; the compiler now treats |
| 995 |
such expressions as valid, and defers their evaluation until run-time, |
| 996 |
so that any operator overloading can be properly applied. |
| 997 |
|
| 998 |
(<a href="http://bugdb.tads.org/view.php?id=0000142">bugdb.tads.org #0000142</a>) |
| 999 |
|
| 1000 |
|
| 1001 |
<li>The standard main window layout code in the Web UI library now |
| 1002 |
loads its Flash helper object (TADS.SWF) dynamically rather than |
| 1003 |
statically, and only does so when it detects that Flash support is |
| 1004 |
already present in the browser. In the past, the TADS.SWF object was |
| 1005 |
embedded statically on the page, which means that the browser saw the |
| 1006 |
object declaration whether or not Flash support was installed. Some |
| 1007 |
browsers attempt to be helpful in this situation by popping up a |
| 1008 |
dialog or prompt pointing out that the page depends on Flash and |
| 1009 |
offering to download and install a Flash plug-in. For users who |
| 1010 |
intentionally omit Flash from their browser configurations, though, |
| 1011 |
this "helpful" prompt is an annoyance, since it comes up every time a |
| 1012 |
page with a Flash embedding is loaded or reloaded and the answer is |
| 1013 |
always No. The library's new approach avoids the superfluous prompt |
| 1014 |
by creating the TADS.SWF object embedding only after determining that |
| 1015 |
Flash is already installed. |
| 1016 |
|
| 1017 |
<p>(There's a trade-off, of course, in that the browsers that display |
| 1018 |
the prompt do so for good reason. Without it, users who |
| 1019 |
<i>un</i>intentionally omitted Flash from their configurations will |
| 1020 |
never know the page makes use of it. This seems like a small price to |
| 1021 |
pay, though, in that (a) most modern browsers include Flash support |
| 1022 |
out of the box anyway (excluding those on iOS, where Flash simply |
| 1023 |
isn't available), so practically everyone who hasn't gone out of their |
| 1024 |
way to remove Flash already has it (or is running on iOS, where |
| 1025 |
there's no need for a prompt since there's no way to install Flash at |
| 1026 |
all); and (b) even if there's anyone left over after considering (a) |
| 1027 |
who could benefit from the prompt, the Web UI only uses Flash as a |
| 1028 |
very minor enhancement (specifically, to obtain a list of installed |
| 1029 |
fonts for the Preferences dialog), so these presumably rare users |
| 1030 |
won't suffer any really significant loss of functionality from the |
| 1031 |
lack of Flash that we're preventing the browser from alerting them |
| 1032 |
to.) |
| 1033 |
|
| 1034 |
(<a href="http://bugdb.tads.org/view.php?id=0000145">bugdb.tads.org #0000145</a>) |
| 1035 |
|
| 1036 |
|
| 1037 |
<li>The compiler didn't generate the full string list properly when |
| 1038 |
the -Os option was used; only strings for the first source module in |
| 1039 |
the build were included, rather than strings for all modules being |
| 1040 |
compiled. (What's more, when the build included many modules, the |
| 1041 |
underlying bug sometimes caused internal memory corruptions within the |
| 1042 |
compiler that generated spurious error messages or other unpredictable |
| 1043 |
results.) This has been corrected. |
| 1044 |
|
| 1045 |
(<a href="http://bugdb.tads.org/view.php?id=0000150">bugdb.tads.org #0000150</a>) |
| 1046 |
|
| 1047 |
|
| 1048 |
</ul> |
| 1049 |
|
| 1050 |
|
| 1051 |
|
| 1052 |
<h3>Changes for 3.1.0 (December 21, 2011)</h3> |
| 1053 |
|
| 1054 |
|
| 1055 |
<p>This update has three main themes: dynamic coding, greater |
| 1056 |
convenience, and network support. On the dynamic code side, it's now |
| 1057 |
possible to compile new code at run-time, and new reflection features |
| 1058 |
provide more thorough run-time access to the program's own internal |
| 1059 |
structure. These dynamic features will be especially interesting to |
| 1060 |
library and extension authors, as they open new opportunities for |
| 1061 |
creating miniature languages within the language. The convenience |
| 1062 |
enhancements involve numerous, mostly small changes that make common |
| 1063 |
tasks easier and frequent coding patterns more compact. As for |
| 1064 |
the new network features, the original motivation and initial |
| 1065 |
application is to run TADS games in a client/server configuration, |
| 1066 |
where the player uses an ordinary browser to access the game, with no |
| 1067 |
need to install TADS or even download a game file. This is just one |
| 1068 |
application of the new technology, though; the network features are |
| 1069 |
actually much more generalized and extensive than this first use might |
| 1070 |
suggest. In effect, TADS is now capable of acting as a fairly |
| 1071 |
complete (if small scale) Web server programming environment. This |
| 1072 |
opens many new possibilities for networked user interfaces and |
| 1073 |
multi-player games. It also has an interesting bonus benefit, which |
| 1074 |
is that it lets you tap into the full power of the browser to create |
| 1075 |
your TADS user interfaces. Modern browsers provide a vastly more |
| 1076 |
powerful user interface platform than HTML TADS (or any other existing |
| 1077 |
IF runtime), and all of that power is now directly available to TADS |
| 1078 |
games. |
| 1079 |
|
| 1080 |
<p>Note that before this version was released, it was sometimes |
| 1081 |
referred to as 3.0.19 (e.g., in the TADS bug database and the T3 |
| 1082 |
blog). If you're looking for 3.0.19 based on something you read |
| 1083 |
elsewhere, this is it. We finally bumped the name up to 3.1 because |
| 1084 |
of the substantial new functionality it contains. |
| 1085 |
|
| 1086 |
|
| 1087 |
<ul> |
| 1088 |
|
| 1089 |
<li><b>Compatibility Alerts:</b> The following changes might affect |
| 1090 |
existing code that was originally created with an earlier version of |
| 1091 |
TADS 3. |
| 1092 |
|
| 1093 |
<ul> |
| 1094 |
|
| 1095 |
<li><tt>operator</tt> is now a reserved word, due to the new operator |
| 1096 |
overloading feature. This means that the word <tt>operator</tt> can't |
| 1097 |
used as a symbol name, such as for the name of an object, function, or |
| 1098 |
local variable. |
| 1099 |
|
| 1100 |
<li><tt>method</tt> is now a reserved word, due to the new "floating" |
| 1101 |
method definition syntax. |
| 1102 |
|
| 1103 |
<li><tt>invokee</tt> is now a reserved word. |
| 1104 |
|
| 1105 |
<li><tt>defined</tt> is now a reserved word. |
| 1106 |
|
| 1107 |
<li><< >> sequences are now meaningful in single-quoted |
| 1108 |
strings, since these strings can now contain expression embeddings. |
| 1109 |
This means that formerly inert << sequences in single-quoted |
| 1110 |
strings will now be interpreted as embeddings. This <i>should</i> |
| 1111 |
be a compatibility issue, but as it happens a fortuitous |
| 1112 |
compiler bug in older versions made it virtually impossible to use |
| 1113 |
<< in single-quoted strings anyway, so this shouldn't affect |
| 1114 |
any existing code. |
| 1115 |
|
| 1116 |
<li>Complex expressions involving compound assignment operators |
| 1117 |
with side effects in their lvalues are now compiled with different |
| 1118 |
(better) |
| 1119 |
behavior. This probably won't affect any existing code, |
| 1120 |
because (a) it only applies to fairly unusual expressions, and (b) anyone |
| 1121 |
who encountered the old behavior probably would have thought it was |
| 1122 |
a bug and changed their code to avoid it. |
| 1123 |
The new behavior is much more predictable and much more what you'd |
| 1124 |
expect, but it's possible that there's existing code that accidentally |
| 1125 |
relies on the old behavior. |
| 1126 |
Details <a href="#compoundAsiSideEffects">below</a>. |
| 1127 |
|
| 1128 |
<li>The regular expression character class <space> now |
| 1129 |
explicitly matches only <i>horizontal</i> whitespace characters, |
| 1130 |
<i>not</i> vertical separators (\n, \r, \b, and a few others). |
| 1131 |
This is actually more likely to fix problems than create new ones, |
| 1132 |
since the old behavior was inconsistent with what most people |
| 1133 |
expect from other regular expression implementations. |
| 1134 |
|
| 1135 |
<li>The rand() function now evaluates only one of its arguments |
| 1136 |
when it's called with multiple arguments. In the past, rand() |
| 1137 |
evaluated all of its argument values first, then randomly selected |
| 1138 |
one of the values as the result. Now, rand() makes the random selection |
| 1139 |
first, then evaluates only the selected item, and returns the result. |
| 1140 |
This means that side effects are only triggered for the selected |
| 1141 |
argument, not for all arguments as in the past. This could conceivably |
| 1142 |
affect existing code that relied on all of the arguments' side effects |
| 1143 |
being executed, although such code tends to be tricky enough that |
| 1144 |
most people avoid it, so the practical impact should be minimal to |
| 1145 |
non-existent. Also, importantly, this is a <b>compiler</b> |
| 1146 |
change only, so it only affects newly compiled code; existing .t3 |
| 1147 |
files already in distribution won't be affected. |
| 1148 |
|
| 1149 |
</ul> |
| 1150 |
|
| 1151 |
<li>It's now possible for a TADS game to be a Web server. This is |
| 1152 |
accomplished with the new intrinsic classes <a |
| 1153 |
href="sysman/httpsrv.htm">HTTPServer</a>, which handles the low-level |
| 1154 |
networking required to receive and parse HTTP requests from Web |
| 1155 |
clients, and <a href="sysman/httpreq.htm">HTTPRequest</a>, which |
| 1156 |
represents an incoming HTTP request from a client; and the new |
| 1157 |
intrinsic function set <a href="sysman/tadsnet.htm">tads-net</a>, |
| 1158 |
which contains additional support functions for networking operations. |
| 1159 |
|
| 1160 |
<p>The new HTTP server support classes are designed to automatically |
| 1161 |
handle all of the low-level necessities of a network service, while |
| 1162 |
still giving the game program full control over how requests are |
| 1163 |
actually processed. This makes it possible to create a wide variety |
| 1164 |
of effects with the network server. Initially, it will be used to |
| 1165 |
present the traditional single-player user interface in a networked |
| 1166 |
configuration, where the game runs on a server and the client needs |
| 1167 |
only an ordinary Web browser. This eliminates the need for clients to |
| 1168 |
install the TADS software, while also greatly expanding the UI |
| 1169 |
capabilities of TADS games by letting you use the full power of HTML |
| 1170 |
DOM and Javascript. Over time, it opens up lots of other |
| 1171 |
possibilities, such as collaborative gaming and multi-player games. |
| 1172 |
|
| 1173 |
<li>In addition to the new ability to act as a Web server, TADS games |
| 1174 |
can now also make HTTP requests as clients, via the new function |
| 1175 |
<a href="sysman/tadsnet.htm#sendNetRequest">sendNetRequest()</a>. |
| 1176 |
This lets a game send information to and receive information from |
| 1177 |
remote Internet servers during play. |
| 1178 |
|
| 1179 |
<li>The interpreter has a new command-line option, <tt>-ns##</tt>, for |
| 1180 |
setting the "network safety level". This is analogous to the file |
| 1181 |
safety level, and controls the program's ability to access the network |
| 1182 |
functions. The "##" part is two digits, the first giving the safety |
| 1183 |
level for <i>client</i> functions, and the second giving the level for |
| 1184 |
<i>server</i> functions. The client level controls outgoing |
| 1185 |
connections from the program to external network services; the server |
| 1186 |
level controls the program's ability to accept connections from |
| 1187 |
external client programs (such as Web browsers). There are three |
| 1188 |
possible values for each component: 0 means "no safety", which allows |
| 1189 |
all network access without restrictions; 1 sets local access only, |
| 1190 |
which only allows connections to or from other applications running on |
| 1191 |
the same computer; and 2 is "maximum safety", meaning no network |
| 1192 |
access is allowed at all. For example, <tt>-ns02</tt> gives the |
| 1193 |
program full access as a client to any external network service |
| 1194 |
anywhere on the network, but at the same time prohibits the program |
| 1195 |
from setting up any network services of its own or accepting any |
| 1196 |
connections from other processes or computers. The default safety |
| 1197 |
level is <tt>-ns11</tt>, which allows the program to connect to and |
| 1198 |
accept connections from other programs on the same machine only. |
| 1199 |
|
| 1200 |
<li>The compiler now accepts "triple-quoted" strings. This |
| 1201 |
<i>isn't</i> a third type of string beyond single- and double-quoted; |
| 1202 |
it's just a new way of writing those two existing string types. A few |
| 1203 |
other C-like languages have adopted this as a nicer syntax for writing |
| 1204 |
strings that contain quote marks as part of their literal text. This |
| 1205 |
is a particularly common need in TADS, since so many strings are |
| 1206 |
part of the story text. |
| 1207 |
|
| 1208 |
<p>A triple-quoted string starts and ends with <i>three copies</i> of |
| 1209 |
the quote mark. What you gain is that you can then freely use the |
| 1210 |
quote mark character within the string <i>without</i> worrying about |
| 1211 |
"escaping" it with a backslash. The traditional C backslash syntax |
| 1212 |
for embedded quotes is awkward to type and hard to read. Triple |
| 1213 |
quotes make strings more readable by letting you use quotes directly |
| 1214 |
in a string without any escape characters. |
| 1215 |
|
| 1216 |
<p> |
| 1217 |
<pre> |
| 1218 |
desc = """The sign reads "Beware of Backslash!"""" |
| 1219 |
</pre> |
| 1220 |
|
| 1221 |
<p>There are a couple of subtleties you should be aware of, so |
| 1222 |
take a look at the <a href="sysman/strlit.htm#tripleQuotes">System |
| 1223 |
Manual</a> for details. |
| 1224 |
|
| 1225 |
<li>Single-quoted strings can now use << >> expression |
| 1226 |
embeddings (including all of the new embedding features, such as |
| 1227 |
<<if>>). The single-quoted version produces a |
| 1228 |
result that's equivalent to concatenating the embedded expressions |
| 1229 |
to the surrounding string fragments. For example, <tt>'one |
| 1230 |
<<two>> three <<four>> five'</tt> is |
| 1231 |
equivalent to <tt>'one ' + two + ' three ' + four + ' five'</tt>. See |
| 1232 |
<a href="sysman/strlit.htm#embedSgl">String Literals</a> in the System |
| 1233 |
Manual for more details. |
| 1234 |
|
| 1235 |
<li>A new <a href="sysman/strlit.htm#strtpl">string embedding |
| 1236 |
template</a> syntax lets you create custom keywords and phrases |
| 1237 |
for use inside embedded |
| 1238 |
expressions. The compiler translates each custom template invocation |
| 1239 |
into a function call, so this is merely a syntactic convenience, but |
| 1240 |
it can make embeddings in strings more readable by avoiding |
| 1241 |
expression-like syntax. For example, you could create |
| 1242 |
a template that lets you write a string like "You currently have |
| 1243 |
<<score in words>>" points", rather than the |
| 1244 |
more techy looking "You currently have <<spellNum(score)>> |
| 1245 |
points". |
| 1246 |
|
| 1247 |
<li>There's a powerful new string embedding syntax for writing |
| 1248 |
passages that vary according to run-time conditions. Traditionally, |
| 1249 |
conditions were embedded in strings using the <tt>?:</tt> operator, as in: |
| 1250 |
|
| 1251 |
<p><pre> |
| 1252 |
desc = "The door is <<isOpen ? 'open' : 'closed'>>." |
| 1253 |
</pre> |
| 1254 |
|
| 1255 |
<p>That's fine for substituting a word or two based on a simple |
| 1256 |
true/false condition, but for anything more complex it can be |
| 1257 |
hard to read. The new syntax improves the situation |
| 1258 |
by making the varying text part |
| 1259 |
of the string, rather than part of the expression. The conditions |
| 1260 |
become almost like markups interposed within the text: |
| 1261 |
|
| 1262 |
<p><pre> |
| 1263 |
desc = "The door is <<if isOpen>>open<<else>>closed<<end>>. " |
| 1264 |
</pre> |
| 1265 |
|
| 1266 |
<p>The improved readability of the new syntax is more obvious with |
| 1267 |
longer passages: |
| 1268 |
|
| 1269 |
<p><pre> |
| 1270 |
desc = "A massive iron door, bristling with rivets and bolts |
| 1271 |
across its surface. <<if isOpen>>It's open a crack, leaving |
| 1272 |
enough room for a mouse or perhaps a small hare to slip |
| 1273 |
through, but probably not quite enough for a burly |
| 1274 |
adventurer. " |
| 1275 |
</pre> |
| 1276 |
|
| 1277 |
<p>Another benefit of the new syntax is that, because the varying text |
| 1278 |
is part of the string rather than part of an embedding, you can freely |
| 1279 |
use additional embeddings within the then/else parts. (That's not |
| 1280 |
possible with <tt>?:</tt> embeddings, since strings inside embedded |
| 1281 |
expressions can't themselves contain any embeddings.) You can even |
| 1282 |
nest <<if>> structures for more complex conditions. |
| 1283 |
|
| 1284 |
<p>As with other embedding syntax, <<if>> can be used |
| 1285 |
in single-quoted strings as well. |
| 1286 |
|
| 1287 |
<p>Full details are in the |
| 1288 |
<a href="sysman/strlit.htm#embeddedIf">System Manual</a>. |
| 1289 |
|
| 1290 |
<li>Another new embedding syntax, |
| 1291 |
<a href="sysman/strlit.htm#oneof"><<one of>></a>, makes it |
| 1292 |
easier to create lists of alternative messages to be chosen randomly |
| 1293 |
or in a cycle (or a combination of the two). |
| 1294 |
<<one of>> variations are defined |
| 1295 |
for simple random selection, shuffling, cycling, "stop" lists, |
| 1296 |
and for various combinations of these, such as going through a |
| 1297 |
list once in sequence and then shuffling it. |
| 1298 |
|
| 1299 |
<p>The traditional way to create random or sequential messages |
| 1300 |
was via the Adv3 EventList class, which of course |
| 1301 |
still works. <<one of>> is much |
| 1302 |
more concise and readable for simple message variations, though, since |
| 1303 |
it doesn't require a separate object declaration for the event list. |
| 1304 |
The new syntax also has the advantage of being nestable inside |
| 1305 |
other <<one of>> structures and <<if>> |
| 1306 |
structures. |
| 1307 |
|
| 1308 |
<li>One more new special embedding: |
| 1309 |
<a href="sysman/strlit.htm#firstTimeOnly"><<first time>></a> |
| 1310 |
shows a message the first time the enclosing string is displayed, |
| 1311 |
and omits it after that. This is really just a special case of |
| 1312 |
<<one of>> (and, in fact, the compiler actually |
| 1313 |
rewrites it that way), but it's such a common motif in IF authoring |
| 1314 |
that the custom syntax seems justified. |
| 1315 |
|
| 1316 |
<li>Speaking of string embedding, the compiler now respects |
| 1317 |
parentheses (and square brackets and curly braces) within an embedded |
| 1318 |
expression when determining where it ends. The compiler previously |
| 1319 |
assumed an embedding ended at the very first >>, regardless |
| 1320 |
of context, but this |
| 1321 |
was problematic if you wanted to use the >> bit-shift operator within an |
| 1322 |
expression. Now, the compiler counts parentheses, brackets, and |
| 1323 |
braces, and treats >> as a bit-shift operator if it |
| 1324 |
appears within a bracketed group. This means you can use the >> |
| 1325 |
operator in an embedded expression simply by parenthesizing the expression. |
| 1326 |
|
| 1327 |
<li>The new TadsObject methods getMethod() and setMethod() give you |
| 1328 |
more dynamic control over objects and classes by letting you add new |
| 1329 |
methods to an existing object. This makes it possible to perform |
| 1330 |
almost any sort of transformation on an object. See the |
| 1331 |
<a href="sysman/tadsobj.htm">TadsObject documentation</a> for details. |
| 1332 |
|
| 1333 |
<li>The new <tt>method</tt> keyword lets you define a "floating" |
| 1334 |
method. This is a routine that's not associated with an object, but |
| 1335 |
which nonetheless has access to the method context variables |
| 1336 |
(targetprop, targetobj, definingobj, and self), as well as |
| 1337 |
<tt>inherited</tt>. This is meant specifically for use with |
| 1338 |
TadsObject.setMethod(): it lets you create a method that's not |
| 1339 |
intially part of any object, and then plug it in as an actual method |
| 1340 |
of selected objects at run-time. Syntactically, a floating method |
| 1341 |
definition looks just like an ordinary function definition, except |
| 1342 |
that whole thing is preceded by the keyword <tt>method</tt> instead of |
| 1343 |
the optional <tt>function</tt> keyword. See the System Manual for <a |
| 1344 |
href="sysman/proccode.htm#floatingMethods">more details</a>. |
| 1345 |
|
| 1346 |
<p>The <tt>method</tt> keyword can also be used to create anonymous |
| 1347 |
methods. These look and act almost the same as anonymous functions. |
| 1348 |
The difference is that an anonymous method doesn't share its |
| 1349 |
method context variables (self, definingobj, targetobj, targetprop) |
| 1350 |
with its enclosing lexical scope. Instead, an anonymous method takes |
| 1351 |
on the "live" values for those variables each time it's called. |
| 1352 |
As with named floating methods, anonymous methods are designed for |
| 1353 |
attaching to objects via setMethod(). |
| 1354 |
<a href="sysman/anonfn.htm#anonMethods">Details</a> are in the |
| 1355 |
System Manual. |
| 1356 |
|
| 1357 |
|
| 1358 |
<li>The new intrinsic class <a |
| 1359 |
href="sysman/dynfunc.htm">DynamicFunc</a> makes it possible for a |
| 1360 |
running program to extend itself by creating new code on the fly. New |
| 1361 |
code is created by compiling a string that contains source code text, |
| 1362 |
just as you'd use in the main program source code. This type of |
| 1363 |
facility is common in modern interpreted languages, especially |
| 1364 |
scripting languages (e.g., Javascript, PHP), where people have found |
| 1365 |
all sorts of uses for it. It's especially interesting in TADS because |
| 1366 |
it opens the door to new string and message processing capabilities. |
| 1367 |
|
| 1368 |
<p>DynamicFunc values behave very much like ordinary function pointers. |
| 1369 |
You can call a DynamicFunc as though it were a function pointer, and |
| 1370 |
you can use a DynamicFunc in TadsObject.setMethod() to create a new |
| 1371 |
method for an object. |
| 1372 |
|
| 1373 |
<li><a href="sysman/gramprod.htm">GrammarProd</a> objects can now be |
| 1374 |
dynamically created, and the grammar rules for an existing GrammarProd |
| 1375 |
can be modified at run-time. The new methods deleteAlt() and |
| 1376 |
clearAlts() remove existing alternatives from a GrammarProd, and the |
| 1377 |
new method addAlt() adds new alternatives. New rules are specified |
| 1378 |
using the same syntax as the regular "grammar" statement. |
| 1379 |
|
| 1380 |
<li>It's now possible to retrieve information on the preprocessor |
| 1381 |
macros defined by the compiled program. This is handled through the |
| 1382 |
existing function <a |
| 1383 |
href="sysman/t3vm.htm#t3GetGlobalSymbols">t3GetGlobalSymbols()</a>, |
| 1384 |
which now takes an optional argument value that selects which type of |
| 1385 |
symbol information to retrieve. The argument is one of the following |
| 1386 |
constant values: T3GlobalSymbols, to retrieve the global symbol table; |
| 1387 |
or T3PreprocMacros, to retrieve the macro symbol table. If you don't |
| 1388 |
include an argument, the global symbol table is retrieved as in the |
| 1389 |
past, so existing code will work unchanged. As with the symbol table, |
| 1390 |
the macro table is available only during preinit, or during normal |
| 1391 |
run-time if the program is compiled with debugging information. |
| 1392 |
|
| 1393 |
<li>It's now possible to get a pointer to an intrinsic (built-in) |
| 1394 |
function. Use the "&" operator, just like with a property name. |
| 1395 |
For example, <tt>&tadsSay</tt> yields a pointer to the tadsSay() |
| 1396 |
intrinsic. These pointers operate just like ordinary function |
| 1397 |
pointers: you can use them to make calls, and you can even use them |
| 1398 |
in TadsObject.setMethod(). |
| 1399 |
|
| 1400 |
<li>For syntactic consistency, the "&" operator can now be used to |
| 1401 |
get a pointer to an ordinary function. |
| 1402 |
|
| 1403 |
<p>(In the past this wasn't allowed, but only for nit-picky |
| 1404 |
reasons. It was felt that, because there wasn't a <i>need</i> |
| 1405 |
for an explicit "pointer-to" operator for functions, "&" shouldn't |
| 1406 |
even be allowed for functions, making its function clearer by virtue |
| 1407 |
of being single-purpose. This was seen as worthwhile because "pointer |
| 1408 |
to property" seems to be a particularly subtle idea for new users, as |
| 1409 |
it's rather abstract and not common in other languages. However, now |
| 1410 |
that we have pointers to built-in functions, we <i>do</i> need an |
| 1411 |
explicit "pointer to" operator for those, and "&" is certainly the |
| 1412 |
right choice: it's the right parallel to C++, on which our syntax was |
| 1413 |
originally modeled, and it's the right analogy to the existing TADS |
| 1414 |
usage of "&" with properties. With the addition of the |
| 1415 |
built-in function pointer type, given that "&<i>property</i>" means |
| 1416 |
"pointer to <i>property</i>", and "&<i>built-in</i>" means |
| 1417 |
"pointer to <i>built-in</i>," it would be confusing if |
| 1418 |
"&<i>function</i>" didn't mean "pointer to function" as well. The |
| 1419 |
only thing left out, really is "&<i>object</i>", but that would be |
| 1420 |
going too far. The analogy with C++ would make "&<i>object</i>" |
| 1421 |
confusing for experienced C++ users because <i>object</i> and |
| 1422 |
&<i>object</i> have quite different meanings in that language.) |
| 1423 |
|
| 1424 |
<li>The new "defined" operator tests at compile time to determine |
| 1425 |
whether a symbol is defined or not. The syntax is |
| 1426 |
<tt>defined(</tt><i>symbol</i><tt>)</tt>; this yields the constant |
| 1427 |
value <tt>true</tt> if <i>symbol</i> is defined at the <b>global</b> |
| 1428 |
level within the program (as a function, object, or property name), |
| 1429 |
<tt>nil</tt> if not. You can use <tt>defined()</tt> in any |
| 1430 |
expression context, such as in the condition of an <tt>if</tt> statement. |
| 1431 |
This operator is particularly useful in libraries, since it makes it |
| 1432 |
possible to write code that conditionally references objects only |
| 1433 |
when they're actually part of the program. See the |
| 1434 |
<a href="sysman/expr.htm#defined">System Manual</a> for details. |
| 1435 |
|
| 1436 |
<p>Note that "defined" still has its separate meaning within |
| 1437 |
#if preprocessor expressions. There, the operator determines if |
| 1438 |
the symbol is defined as a <b>preprocessor</b> (#define) symbol. |
| 1439 |
When used outside of #if expressions, "defined" has the |
| 1440 |
new meaning of testing the symbol's presence in the compiler |
| 1441 |
global symbols rather than the preprocessor macro symbols. |
| 1442 |
|
| 1443 |
<li>The "new" keyword is no longer required (although it's still |
| 1444 |
allowed) in the definition of a long-form anonymous function. For |
| 1445 |
example, it's now valid to write code like <tt>lst.mapAll(function(x) |
| 1446 |
{ return x+1; })</tt>. The presence or absence of the "new" makes no |
| 1447 |
difference to the meaning. |
| 1448 |
|
| 1449 |
<p>The original rationale for requiring "new" was that anonymous |
| 1450 |
functions are actually objects that are newly created on each |
| 1451 |
evaluation, so it was felt that this should be made explicit in the |
| 1452 |
syntax. The rationale for now relaxing the "new" requirement is that |
| 1453 |
"closures" (as they're more technically known) have become common in |
| 1454 |
other mainstream languages, and no one else seems to think the syntax |
| 1455 |
should mimic object construction. (For that matter, TADS's own |
| 1456 |
short-form syntax never had the "new".) There's also a good |
| 1457 |
pragmatic reason: with the new Web UI, TADS programmers might find |
| 1458 |
themselves switching back and forth between TADS and Javascript, |
| 1459 |
since the Web UI incorporates a substantial Javascript front end. |
| 1460 |
Javascript's anonymous function syntax is almost exactly like TADS's |
| 1461 |
long-form syntax, except that Javascript doesn't have the "new". Such |
| 1462 |
close-but-not-perfect similarities are particularly vexing |
| 1463 |
when switching between languages, so it seemed best to eliminate the |
| 1464 |
unnecessary difference. |
| 1465 |
|
| 1466 |
<li>Short-form anonymous functions can now define their own local |
| 1467 |
variables. Use the <tt>local</tt> keyword as usual, at the beginning |
| 1468 |
of the function's expression. The syntax is analogous to defining |
| 1469 |
locals within a <tt>for</tt> statement's initializer clause. See <a |
| 1470 |
href="sysman/anonfn.htm#shortFormLocals">Anonymous Functions</a> in |
| 1471 |
the System Manual for details and examples. |
| 1472 |
|
| 1473 |
<p>This is convenient because it lets you use the short-form |
| 1474 |
syntax even if the function requires a local variable or two. In the |
| 1475 |
past, you had to switch to the long-form syntax to define a local, |
| 1476 |
even if the rest of the function simply returned an expression value. |
| 1477 |
|
| 1478 |
<li>The syntax of the <tt>for</tt> loop has been extended with |
| 1479 |
three new features: |
| 1480 |
|
| 1481 |
<ul> |
| 1482 |
<li><b>for..in:</b>: |
| 1483 |
<tt>for (x in collection)</tt> is now synonymous with the |
| 1484 |
existing <tt>foreach</tt> syntax. This makes the syntax more |
| 1485 |
uniform, which makes the language easier to use by eliminating |
| 1486 |
the need to remember to use distinct keywords for the two kinds |
| 1487 |
of loops. |
| 1488 |
|
| 1489 |
<li><b>Hybrid for and for..in loops:</b> The "in" syntax newly |
| 1490 |
allowed in <tt>for</tt> loops can also be combined with the |
| 1491 |
conventional three-part init/condition/update syntax. This |
| 1492 |
allows you to add other looping variables to an "in" iteration. |
| 1493 |
One of the drawbacks of the <tt>foreach</tt> syntax is that any |
| 1494 |
other looping variables have to be initialized before the <tt>foreach</tt> |
| 1495 |
and updated and/or tested within the loop body. <tt>for</tt> loops, |
| 1496 |
in contrast, can manage multiple variables as part of explicit |
| 1497 |
loop structure within the <tt>for</tt> statement itself, which |
| 1498 |
is more compact and often clearer. For example, to add a counter |
| 1499 |
to an "in" loop, and stop after 10 iterations even if more |
| 1500 |
elements are in the list, you could write |
| 1501 |
<tt>for (local i = 1, local ele in list ; i < 10 ; ++i) { }</tt>. |
| 1502 |
|
| 1503 |
<li><b>for..in range loops:</b> By far the most common type of |
| 1504 |
<tt>for</tt> loop is a simple iteration over a range of integers, |
| 1505 |
such as over the index range for a list. There's now a custom |
| 1506 |
syntax for this kind of loop: <tt>for (<i>var</i> in <i>from</i> |
| 1507 |
.. <i>to</i>)</tt>. This syntax steps the variable <i>var</i> |
| 1508 |
from the <i>from</i> expression's value to the <i>to</i> |
| 1509 |
expression's value, inclusive of the limits. For example, to |
| 1510 |
step through the index values for a list, you can write |
| 1511 |
<tt>for (local i in 1..list.length())</tt>. This new syntax |
| 1512 |
makes simple integer loops easier to write and clearer. It |
| 1513 |
also makes them more reliable, since a common coding error |
| 1514 |
is using <tt><</tt> instead of <tt><=</tt> (or vice |
| 1515 |
versa) for a loop condition. The range syntax is more intuitive |
| 1516 |
because it explicitly states the endpoints rather than expressing |
| 1517 |
the loop condition as a value comparison. The new syntax also |
| 1518 |
allows specifying the increment: <tt>for (i in 0..20 step 2)</tt> |
| 1519 |
steps through even numbers, and <tt>for (i in 10..1 step -1)</tt> |
| 1520 |
steps down from 10 to 1. As with collection loops, you can mix |
| 1521 |
this syntax with the full three-part <tt>for</tt> syntax: |
| 1522 |
<tt>for (local i in 1..20, sum = 0 ; lst[i] != nil ; sum += lst[i])</tt>. |
| 1523 |
|
| 1524 |
</ul> |
| 1525 |
|
| 1526 |
<p>The new syntax is described in more detail in the <a |
| 1527 |
href="sysman/proccode.htm#for">System Manual</a>. |
| 1528 |
|
| 1529 |
<li>A new language feature lets you pass argument values to functions |
| 1530 |
and methods using explicit argument names. This has several important |
| 1531 |
benefits. First, callees can retrieve argument values from callers |
| 1532 |
without regard to the order of the values in the calling expression. |
| 1533 |
Second, callees are free to ignore named parameters entirely, which |
| 1534 |
allows a caller to pass extra, optional context information without |
| 1535 |
burdening every callee's method definition syntax with unneeded extra |
| 1536 |
parameter declarations. Third, nested callees can retrieve named |
| 1537 |
arguments passed indirectly from a caller several levels removed, so |
| 1538 |
intermediate functions that don't care about context information can |
| 1539 |
ignore it without preventing nested callees from accessing it. This |
| 1540 |
doesn't replace the traditional positional argument system, but rather |
| 1541 |
extends it. Some other languages use named arguments primarily for |
| 1542 |
code clarity reasons, but the TADS version is designed to address a |
| 1543 |
particular coding problem that comes up time and again in IF library |
| 1544 |
design. The details take a little work to explain; the new System |
| 1545 |
Manual chapter on <a href="sysman/namedargs.htm">Named Arguments</a> |
| 1546 |
has the full story. |
| 1547 |
|
| 1548 |
<li>New syntax makes it easier to define functions and methods that |
| 1549 |
take optional arguments. It's always been possible to do something |
| 1550 |
similar using the "..." syntax, but "..." is really intended for cases |
| 1551 |
where the number of additional arguments is unpredictable and has no |
| 1552 |
fixed upper limit. The new syntax, in contrast, is for cases where |
| 1553 |
you have a specific number of arguments, but where you wish to make |
| 1554 |
one or more of the arguments optional, so that callers can omit them |
| 1555 |
for the most common case where a default value would apply. This |
| 1556 |
makes the calling syntax more convenient for the common case, while |
| 1557 |
still letting callers specify the full details when needed. "..." |
| 1558 |
isn't ideal for this use because it doesn't provide error checking for |
| 1559 |
<i>too many</i> parameters, and because it requires fairly tedious |
| 1560 |
extra syntax in the callee to check for the presence of the extra |
| 1561 |
arguments and retrieve their values. The new syntax is described in |
| 1562 |
detail in the new System Manual chapter on <a |
| 1563 |
href="sysman/optparams.htm">optional parameters</a>. |
| 1564 |
|
| 1565 |
<li>The new <a href="sysman/expr.htm#invokee"><tt>invokee</tt></a> |
| 1566 |
pseudo-variable retrieves a pointer to the function currently executing. |
| 1567 |
This is most useful for anonymous functions, since it provides a way |
| 1568 |
for an anonymous function to invoke itself recursively. |
| 1569 |
|
| 1570 |
<li>The t3GetStackTrace() function can now retrieve information on the |
| 1571 |
local variables in effect at each stack level. The locals are |
| 1572 |
available via the locals_ property of the T3StackInfo object that |
| 1573 |
represents a stack level. |
| 1574 |
|
| 1575 |
<p>By default, locals are omitted, since they take additional time to |
| 1576 |
retrieve. To include local variable information, supply the new |
| 1577 |
<i>flags</i> argument with the value T3GetStackLocals. (This is a bit |
| 1578 |
value; it's possible that future bit values will be added, in which |
| 1579 |
case this will be combinable with other bit flags via the '|' |
| 1580 |
operator.) |
| 1581 |
|
| 1582 |
<p>The locals in each stack frame are provided as a LookupTable. Each |
| 1583 |
element of the table is keyed by a string giving the name of the |
| 1584 |
variable, and each corresponding table value is the current value of |
| 1585 |
the local. The table is merely a copy of the locals in the stack, |
| 1586 |
a value in the table won't have any effect on the local variables |
| 1587 |
themselves. |
| 1588 |
|
| 1589 |
<li>The t3GetStackTrace() function now includes information on the |
| 1590 |
named arguments passed to each stack frame. This is available via |
| 1591 |
the namedArgs_ property of the T3StackInfo object that represents |
| 1592 |
each stack level. This property is nil for a stack level that |
| 1593 |
doesn't have named arguments. |
| 1594 |
|
| 1595 |
<p>Each named argument list is provided as a LookupTable. Each element |
| 1596 |
of the table is keyed by a string giving the name of the argument, |
| 1597 |
and each corresponding table value is the argument's value. |
| 1598 |
|
| 1599 |
<li>The t3GetStackTrace() function now includes full information on |
| 1600 |
"native" calls in the stack - that is, intrinsic functions and |
| 1601 |
intrinsic class methods. In the past, native callers were recognizable |
| 1602 |
by their complete lack of information, in that they had a nil value |
| 1603 |
for both the calling function and object/property values. |
| 1604 |
|
| 1605 |
<p>This change comes into play when a native routine calls bytecode |
| 1606 |
via a function pointer you passed into the native routine, such as |
| 1607 |
when List.forEach() invokes its callback. When the native caller is a |
| 1608 |
built-in function, the function pointer element of the stack level |
| 1609 |
object will contain a built-in function pointer value; when it's an |
| 1610 |
intrinsic class method, it will contain suitable object and property |
| 1611 |
values describing the native method. For obvious reasons, there's no |
| 1612 |
source file information for a native routine in the stack trace. |
| 1613 |
|
| 1614 |
<li>The new intrinsic class StackFrameDesc provides read and write |
| 1615 |
access to the local variables in a stack frame. You obtain a |
| 1616 |
StackFrameDesc object via t3GetStackTrace() by including the |
| 1617 |
T3GetStackDesc flag. The object provides methods to get and set the |
| 1618 |
values of local variables, and to retrieve the method context |
| 1619 |
variables (self, targetobj, targetprop, definingobj). See the System |
| 1620 |
Manual chapter for <a href="sysman/framedesc.htm">more information</a>. |
| 1621 |
|
| 1622 |
<li>A new language and VM feature make it possible to "overload" |
| 1623 |
operators. This means that you can define a method on an object or |
| 1624 |
class that's invoked using one of the algebraic operator symbols, such |
| 1625 |
as "+" or "*", rather than via the normal method call syntax. |
| 1626 |
Operator overloading has many potential uses, but the two main uses |
| 1627 |
are (1) to create an especially compact syntax for common operations |
| 1628 |
on specialized objects, and (2) to create a custom object that mimics |
| 1629 |
the low-level interface of one of the built-in types or classes. The |
| 1630 |
details are described more fully in a <a |
| 1631 |
href="sysman/opoverload.htm">new chapter</a> in the system manual. |
| 1632 |
|
| 1633 |
<p>Operator overloading has three significant limitations. First, you |
| 1634 |
can't <i>override</i> operators pre-defined by intrinsic classes. For |
| 1635 |
example, you can't redefine the indexing operator "[]" for a List, or |
| 1636 |
the concatenation operator "+" for a String. You can, however, |
| 1637 |
<i>add</i> operators to intrinsic classes: it's legal to use "modify" |
| 1638 |
to define an operator on an intrinsic class as long as that operator |
| 1639 |
isn't already defined by the intrinsic class itself. Second, there's |
| 1640 |
no way to overload operators at all for a primitive type like integer, |
| 1641 |
whether or not the type defines it: you can't change the meaning of |
| 1642 |
"+" when applied to integers, or add a meaning for "true + nil". |
| 1643 |
Third, not all operators are overloadable; notably, none of the |
| 1644 |
comparison operators (==, !=, <, <=, >, >=) are |
| 1645 |
overloadable. All of these limitations are due to performance |
| 1646 |
considerations; with these restrictions in place, this new feature has |
| 1647 |
no performance cost to programs that don't use it. |
| 1648 |
|
| 1649 |
<li>Using operator overloading, it's now possible to create |
| 1650 |
"list-like" objects. An object is considered list-like if it has an |
| 1651 |
overload for <tt>operator[]</tt> <i>and</i> it provides a |
| 1652 |
<tt>length()</tt> method that takes zero arguments. If the object |
| 1653 |
provides this interface, the <tt>length()</tt> method <b>must</b> |
| 1654 |
return an integer value. |
| 1655 |
|
| 1656 |
<p>The following built-in functions that formerly only accepted |
| 1657 |
regular lists and/or vectors will now also accept list-like objects: |
| 1658 |
inputDialog(), makeString(), rand(), Dictionary.addWord(), |
| 1659 |
Dictionary.removeWord(), List.intersect(), List.appendUnique(), new |
| 1660 |
LookupTable(), GrammarProd.parseTokens(), new StringComparator(), |
| 1661 |
TadsObject.setSuperclassList(), new Vector(), Vector.appendAll(), |
| 1662 |
Vector.appendUnique(), Vector.copyFrom(). Similarly, the "..." |
| 1663 |
varying argument expansion operator can be applied to a list-like |
| 1664 |
object as though it were a true list; and List and Vector comparisons |
| 1665 |
with "==" and "!=" will compare element-by-element against a list-like |
| 1666 |
value on the right-hand side; and the List and Vector "+" and "-" |
| 1667 |
operators will treat right-hand operands as lists if they're list-like |
| 1668 |
objects. |
| 1669 |
|
| 1670 |
<li>New syntax lets you create a LookupTable directly from a set of |
| 1671 |
Key/Value pairs. The syntax is similar to a list expression: write |
| 1672 |
the list of Key->Value pairs in square brackets, with an arrow |
| 1673 |
symbol '->' between each key and value. For example, <tt>x = |
| 1674 |
['one'->1, 'two'->2, 'three'->3]</tt> creates a LookupTable |
| 1675 |
with keys 'one', 'two', and 'three', corresponding to values 1, 2, and |
| 1676 |
3, so x['one'] yields 1, and so on. This syntax is equivalent to |
| 1677 |
calling <tt>new LookupTable()</tt> and then filling in the keyed |
| 1678 |
values, so this kind of expression creates a new LookupTable object |
| 1679 |
each time it's evaluated. |
| 1680 |
|
| 1681 |
<li>The LookupTable class now lets you specify the value to be returned |
| 1682 |
when you index a table with a key that doesn't exist in the table. |
| 1683 |
This is called the "default value" for the table; in the past, this |
| 1684 |
was always nil. The new <tt>setDefaultValue()</tt> method lets you |
| 1685 |
set a different default. You can retrieve the default value |
| 1686 |
previously set for a table with the new <tt>getDefaultValue()</tt> |
| 1687 |
method. The initial default value for a new table is nil, so the |
| 1688 |
behavior is the same as in prior versions if you don't use the new |
| 1689 |
method. You can also specify the default value when creating a table |
| 1690 |
with the new shorthand syntax, by writing |
| 1691 |
"<tt>*-><i>value</i></tt>" as the last element of the list. (The |
| 1692 |
asterisk is meant to suggest a "wildcard" matching any key not |
| 1693 |
specifically entered in the table.) |
| 1694 |
|
| 1695 |
<li>The Dictionary class has new built-in infrastructure support for |
| 1696 |
spelling correctors. The new function correctSpelling() retrieves a |
| 1697 |
list of words in the dictionary that are within a specified "edit |
| 1698 |
distance" of a given string. This new function isn't a full-fledged |
| 1699 |
spelling corrector, but provides a very fast version of a key |
| 1700 |
infrastructure element for building one. Refer to the <a |
| 1701 |
href="sysman/dict.htm#spellingCorrection">Dictionary class |
| 1702 |
documentation</a> for details. |
| 1703 |
|
| 1704 |
<li>The new intrinsic class <a |
| 1705 |
href="sysman/strbuf.htm">StringBuffer</a> is a mutable version of the |
| 1706 |
character string object. Unlike regular String objects, a |
| 1707 |
StringBuffer's text contents can be modified in place, without |
| 1708 |
creating new String objects. StringBuffer is designed especially for |
| 1709 |
situations where it takes many incremental steps to build a string. |
| 1710 |
It's much more efficient to use StringBuffer for these cases than it |
| 1711 |
is to use regular string concatenation, because the latter makes a new |
| 1712 |
copy of each concatenated combination. StringBuffer provides methods |
| 1713 |
to edit the contents of the buffer: you can insert, append, delete, |
| 1714 |
and replace parts of the text. When you've finished the build steps |
| 1715 |
for a string buffer, you can convert it to a regular string using |
| 1716 |
toString(). You can also extract a substring of the buffer using the |
| 1717 |
substr() method, just like for a regular string. |
| 1718 |
|
| 1719 |
<li>The <a href="sysman/tadsgen.htm#rexReplace">rexReplace()</a> |
| 1720 |
function has several new features that make it more powerful |
| 1721 |
and more convenient to use: |
| 1722 |
|
| 1723 |
<ul> |
| 1724 |
|
| 1725 |
<li>You can now specify a function to determine the replacement |
| 1726 |
text to use for each match. If you supply a function (regular or |
| 1727 |
anonymous) in place of the regular replacement text argument, |
| 1728 |
rexReplace() calls the function for each match, passing as arguments |
| 1729 |
the matched text, the index of the match within the overall subject |
| 1730 |
string, and the original subject string. Your callback function |
| 1731 |
returns a string value giving the text to use as the replacement. |
| 1732 |
This allows for much more complex string manipulations, since you can |
| 1733 |
test conditions that are beyond what can be encoded in a regular |
| 1734 |
expression, and you can apply arbitrary transformations to the match |
| 1735 |
string to produce the replacement text. |
| 1736 |
|
| 1737 |
<li>You can now specify a list of patterns to match, instead of |
| 1738 |
just a single pattern, and each pattern can have a separate |
| 1739 |
replacement value (which can be a string or a callback function, per |
| 1740 |
the new callback feature above). By default, when you supply a list |
| 1741 |
of patterns, rexReplace() searches for all of the patterns at once. |
| 1742 |
This is similar to combining the patterns with '|' to make a single |
| 1743 |
pattern, but it's more powerful because it lets you specify a |
| 1744 |
different replacement string for each pattern. If you include |
| 1745 |
ReplaceSerial in the flags, rexReplace() instead searches "serially" |
| 1746 |
for the patterns: it replaces each occurrence of the first pattern |
| 1747 |
throughout the entire string, and then re-scans the updated string to |
| 1748 |
replace all occurrences of the second pattern, and so on. The effect |
| 1749 |
is the same as calling rexReplace() sequentially with each individual |
| 1750 |
pattern, but it's more compact to write it this way. |
| 1751 |
|
| 1752 |
<li>The "flags" argument is now optional. If it's omitted, |
| 1753 |
the default is ReplaceAll. This makes the function more convenient |
| 1754 |
to use for the most common case. Note that if you need to specify |
| 1755 |
the "index" argument, you must also include a "flags" value, since |
| 1756 |
the arguments are positional. |
| 1757 |
|
| 1758 |
<li>The new flag ReplaceIgnoreCase makes the search insensitive to |
| 1759 |
case, by default. A <case> or <case> directive in the |
| 1760 |
regular expression overrides the ReplaceIgnoreCase setting. The main |
| 1761 |
reason this flag is provided at all (given that it's largely redundant |
| 1762 |
with the <case> or <case> directives) is for uniformity |
| 1763 |
with String.findReplace(), but it can occasionally be useful in that |
| 1764 |
lets you reuse an expression for both case-sensitive and |
| 1765 |
case-insensitive searches. |
| 1766 |
|
| 1767 |
<li>The new flag ReplaceFollowCase makes the replacement follow the |
| 1768 |
capitalization pattern of the matched text. Lower-case letters in the |
| 1769 |
replacement text are capitalized (or not) as follows: if all of the |
| 1770 |
alphabetic characters in the matched text are capitals, the entire |
| 1771 |
replacement text is capitalized; if all of the letters in the match |
| 1772 |
are lower-case, the replacement text is left in lower-case; if the |
| 1773 |
match has both capitals and lower-case letters, the first alphabetic |
| 1774 |
character of the replacement text is capitalized. This only applies |
| 1775 |
to lower-case letters in a replacement string, and only to literal |
| 1776 |
text: "%" group substitutions aren't affected, since they already copy |
| 1777 |
text directly from the match anyway. The flag also has no effect when |
| 1778 |
the replacement is a callback function rather than a string; we have |
| 1779 |
to assume the function returns exactly what it wants, since it can |
| 1780 |
perform similar case manipulations of its own. |
| 1781 |
|
| 1782 |
</ul> |
| 1783 |
|
| 1784 |
<li>The String method <a |
| 1785 |
href="sysman/string.htm#findReplace">findReplace()</a> has a few new |
| 1786 |
features: |
| 1787 |
|
| 1788 |
<ul> |
| 1789 |
|
| 1790 |
<li>You can now specify a list of search strings, and a list of |
| 1791 |
corresponding replacements. This makes it possible to perform a whole |
| 1792 |
series of replacements with a single call. |
| 1793 |
|
| 1794 |
<li>You can now pass a function in place of a string as the |
| 1795 |
replacement argument. For each match, findReplace() invokes the |
| 1796 |
function, passing in the matched text and other information; |
| 1797 |
the function returns a string giving the replacement text. This |
| 1798 |
makes it possible to vary the replacement according to the actual |
| 1799 |
matched text, its position in the subject string, or other factors. |
| 1800 |
|
| 1801 |
<li>The "flags" argument is now optional. If it's omitted, the |
| 1802 |
default is ReplaceAll. This makes the most common usage more |
| 1803 |
convenient. Note that if you need to specify an "index" value |
| 1804 |
(for the starting position), you'll need to include a "flags" |
| 1805 |
value, since the arguments are positional. |
| 1806 |
|
| 1807 |
<li>The new flag ReplaceIgnoreCase makes the search insensitive |
| 1808 |
to capitalization. |
| 1809 |
|
| 1810 |
<li>The new flag ReplaceFollowCase makes the replacement text |
| 1811 |
follow the case of the matched text, mimicking its capitalization |
| 1812 |
pattern. |
| 1813 |
|
| 1814 |
</ul> |
| 1815 |
|
| 1816 |
<li>The functions rexMatch(), rexSearch(), and rexReplace(), and the |
| 1817 |
String methods toUnicode(), find(), and findReplace() now accept a |
| 1818 |
negative values for the "index" argument. This is taken as an index |
| 1819 |
from the end of the string: -1 is the last character, -2 the second to |
| 1820 |
last, and so on. For the search and replace functions, a negative |
| 1821 |
index doesn't change the left-to-right order of the search; it's |
| 1822 |
simply a convenience for specifying the starting point. Some other |
| 1823 |
string methods already accepted this notation, so these additions make |
| 1824 |
the API more consistent. |
| 1825 |
|
| 1826 |
<li>The regular expression matcher now matches <space> only to |
| 1827 |
<i>horizontal</i> whitespace characters. In the past, <space> |
| 1828 |
matched some vertical whitespace characters as well, but this was |
| 1829 |
inconsistent with the usual matching rules in most other regular |
| 1830 |
expression implementations, and was usually undesirable. The new |
| 1831 |
character type <vspace> explicitly matches vertical whitespace: |
| 1832 |
'\n', '\r', '\b', '\u2028', '\u2029', and a few ASCII control |
| 1833 |
characters that the Unicode standard defines as line break characters |
| 1834 |
('\u0085', '\u001C', '\u001D', '\u001E'). To create a character |
| 1835 |
class matcher that matches all whitespace, the way <space> |
| 1836 |
did in the past, use <space|vspace>. |
| 1837 |
|
| 1838 |
<li>Look-back <a href="sysman/regex.htm#assertions">assertions</a> are |
| 1839 |
now supported in the regular expression language. A look-back |
| 1840 |
assertion tests a sub-pattern against the characters <i>preceding</i> |
| 1841 |
the current match point, which makes it possible to apply conditions |
| 1842 |
to the preceding context where a potential match appears. TADS follows |
| 1843 |
the widely-used Perl-style syntax for the new assertions. |
| 1844 |
|
| 1845 |
<li>In the past, the regular expression compiler explicitly ignored |
| 1846 |
any closure operator (*, +, {}) applied to an assertion, because such |
| 1847 |
constructs are essentially meaningless and are susceptible to infinite |
| 1848 |
loops. The compiler no longer takes this approach; instead, it does a |
| 1849 |
thorough check for meaningless loops in the regular expression, and |
| 1850 |
deletes them. This is an improvement because it detects all loops, no |
| 1851 |
matter how complex, whereas the old approach only caught this one |
| 1852 |
superficial case. This change creates one behavior difference, which |
| 1853 |
is that it corrects the effect of the * operator applied to an |
| 1854 |
assertion: in the past, the * was simply ignored, whereas it now |
| 1855 |
correctly requires that the assertion is true zero or more times. |
| 1856 |
This is the same as removing the assertion entirely, since a condition |
| 1857 |
that has to be true zero or more times is really no condition at all. |
| 1858 |
|
| 1859 |
<li>The new function <a |
| 1860 |
href="sysman/tadsgen.htm#sprintf">sprintf()</a> creates formatted text |
| 1861 |
from data values according to a format template string. This is |
| 1862 |
similar to the sprintf() function in many C-like languages. This |
| 1863 |
style of string formatting is sometimes more compact and convenient |
| 1864 |
than the alternatives. sprintf() is also particularly useful for |
| 1865 |
formatting numbers, since it has several style options for integers |
| 1866 |
and floating-point values that are tedious to code by hand. |
| 1867 |
|
| 1868 |
<li>The new String method <a href="sysman/string.htm#splice">splice()</a> |
| 1869 |
lets you delete a portion of a string, insert new text into a string, |
| 1870 |
or both at the same time. splice(idx, del, ins) deletes <i>del</i> |
| 1871 |
characters starting at index <i>idx</i>, and then inserts the string |
| 1872 |
<i>ins</i> in their place. The <i>ins</i> string is optional, so you |
| 1873 |
can omit it if you just want to delete a segment of the string. |
| 1874 |
|
| 1875 |
<li>The String method substr() now accepts a negative value for the |
| 1876 |
length argument, which specifies a number of characters to discard |
| 1877 |
from the end of the string. |
| 1878 |
|
| 1879 |
<li>The new String method <a href="sysman/string.htm#split">split()</a> |
| 1880 |
divides a string into substrings at a given delimiter, which can be |
| 1881 |
given as either a string or a RexPattern (regular expression pattern). |
| 1882 |
It can alternatively split a string into substrings of a fixed length. |
| 1883 |
This method comes in handy for surprisingly many simple string parsing jobs. |
| 1884 |
|
| 1885 |
<li>The new List method <a href="sysman/list.htm#join">join()</a> |
| 1886 |
concatenates the elements of the list together into a string. |
| 1887 |
<a href="sysman/vector.htm">Vector</a> has this same new method. |
| 1888 |
|
| 1889 |
<li>The new String method <a href="sysman/string.htm#specialsToHtml"> |
| 1890 |
specialsToHtml()</a> converts special TADS characters (such as \n |
| 1891 |
and \b sequences) to standard HTML equivalents. This is designed |
| 1892 |
specifically for the Web UI, to make it easier to port games between |
| 1893 |
the traditional console UI and the Web UI by providing support in |
| 1894 |
the Web UI for the traditional (pre-HTML) TADS formatting codes. |
| 1895 |
|
| 1896 |
<li>Another new String method, <a |
| 1897 |
href="sysman/string.htm#specialsToText"> specialsToText()</a>, is |
| 1898 |
similar to specialsToHtml(), but converts the string to plain text. |
| 1899 |
Special TADS characters are converted to their plain text equivalents, |
| 1900 |
the basic HTML "&" entities are converted to their character |
| 1901 |
equivalents, a few basic tags (<BR>, <P>, and a few |
| 1902 |
others) are converted to suitable plain-text equivalents, and most |
| 1903 |
other tags are stripped out. This is designed for situations where |
| 1904 |
you need a plain-text rendering of the way a TADS string would look |
| 1905 |
as displayed on the regular output console. |
| 1906 |
|
| 1907 |
<li>The new string methods <a href="sysman/string.htm#urlEncode">urlEncode()</a> |
| 1908 |
and <a href="sysman/string.htm#urlDecode">urlDecode()</a> simplify |
| 1909 |
encoding and decoding URL parameter strings, for use in HTTP network |
| 1910 |
requests. urlEncode() converts special characters to "%" encodings; |
| 1911 |
urlDecode() reverses the effect, translating "%" encodings back to |
| 1912 |
the character equivalents. |
| 1913 |
|
| 1914 |
<li>Two new String methods, <a href="sysman/string.htm#sha256">sha256()</a> |
| 1915 |
and <a href="sysman/string.htm#digestMD5">digestMD5()</a>, calculate |
| 1916 |
standard hash values for the string's contents. sha256() calculates |
| 1917 |
the 256-bit SHA-2 (Secure Hash Algorithm 2) hash, and digestMD5() |
| 1918 |
calculates the MD5 message digest. The same methods are available on |
| 1919 |
ByteArray to hash the byte array's contents, and on File to hash |
| 1920 |
bytes from the file. |
| 1921 |
|
| 1922 |
<li>It's now easier to convert between strings and ByteArray objects. |
| 1923 |
First, a ByteArray can now be converted to a string via toString(), or |
| 1924 |
via implicit conversions, such as a "<< >>" embedding in a |
| 1925 |
string. The bytes in the array are simply treated as Unicode |
| 1926 |
character codes. Second, ByteArray.mapToString() can now be called |
| 1927 |
without a character set argument, or with nil for the character set; |
| 1928 |
this performs the same conversion as toString(). Third, the ByteArray |
| 1929 |
constructor has two new formats: <tt>new ByteArray('string')</tt> |
| 1930 |
creates an array containing the string, treating each character as a |
| 1931 |
Latin-1 character; and <tt>new ByteArray('string', |
| 1932 |
<i>charmap</i>)</tt> is equivalent to |
| 1933 |
<tt>'string'.mapToByteArray(<i>charmap</i>)</tt>, but is a little more |
| 1934 |
intuitive syntactically. Similarly, String.mapToByteArray() can now |
| 1935 |
be called without the character mapper argument, which is equivalent |
| 1936 |
to <tt>new ByteArray('string')</tt>. |
| 1937 |
|
| 1938 |
<li>ByteArray.mapToString(), the ByteArray constructor, and |
| 1939 |
String.mapToByteArray() now accept a string giving the name of a |
| 1940 |
character set in place of a CharacterSet object. The methods simply |
| 1941 |
create a CharacterSet object for the given name automatically. This |
| 1942 |
is more convenient for one-off conversions, but if you're using a |
| 1943 |
character set repeatedly keep in mind that it's more efficient for you |
| 1944 |
to create the object once and reuse it. |
| 1945 |
|
| 1946 |
<li>Concatenating nil to a string with the "+" operator now simply |
| 1947 |
yields the original string. That is, nil is treated as equivalent to |
| 1948 |
an empty string for this operator. In the past, the literal string |
| 1949 |
"nil" was appended instead. This was almost never useful, whereas |
| 1950 |
it's often a convenience to have nil treated as an empty string in |
| 1951 |
this situation. |
| 1952 |
|
| 1953 |
<li>The compiler now recognizes the "\r" escape code in string |
| 1954 |
literals. \r represents a Carriage Return character, ASCII 13, which |
| 1955 |
is the same meaning this code has in C, C++, Java, and Javascript. \r |
| 1956 |
wasn't part of the TADS escape set historically (although you could |
| 1957 |
always code it numerically as \015 or \u000D), mostly because there |
| 1958 |
was never much need for it in practice. TADS tries to smooth out |
| 1959 |
newline differences among platforms by representing all newline |
| 1960 |
sequences as \n characters, so it's rare for a \r to find its way into |
| 1961 |
a TADS string in the first place. We've added \r mostly for the sake |
| 1962 |
of completeness and familiarity for C/Java programmers. |
| 1963 |
|
| 1964 |
<li>The built-in function makeString() now returns an empty string if |
| 1965 |
the repeat count argument is zero, and throws an error if the count is |
| 1966 |
less than zero. In the past, all repeat counts less than 1 were |
| 1967 |
treated as though 1 were specified. |
| 1968 |
|
| 1969 |
<li>The new List method <a href="sysman/list.htm#splice">splice()</a> |
| 1970 |
lets you delete a portion of a List, insert new elements into the |
| 1971 |
list, or both at the same time. splice(idx, del, ins1, ins2, ...) |
| 1972 |
deletes <i>del</i> elements of the list starting at index <i>idx</i>, |
| 1973 |
and then inserts the new elements <i>ins1</i>, <i>ins2</i>, etc., in |
| 1974 |
their place. The new elements are optional; if they're omitted, the |
| 1975 |
method only does the deletion. If <i>del</i> is 0, the method only |
| 1976 |
does the insertion. The equivalent method is also now available |
| 1977 |
for <a href="sysman/vector.htm#splice">Vector</a>. |
| 1978 |
|
| 1979 |
<li>The new static List method <a |
| 1980 |
href="sysman/list.htm#generate">generate()</a> creates a list with a |
| 1981 |
given number of elements by invoking a callback function to generate |
| 1982 |
each element's value. This is similar to mapAll(), but rather than |
| 1983 |
transforming an existing list, generate() constructs a new list from a |
| 1984 |
formula. For example, for a list of the first ten even integers, we |
| 1985 |
can write <tt>List.generate({i: i*2}, 10)</tt>. |
| 1986 |
|
| 1987 |
<p>Vector.generate() works the same way to generate a new Vector. |
| 1988 |
|
| 1989 |
<li>The Vector constructor now allows you to omit the initial |
| 1990 |
allocation argument in most cases. You can call <tt>new Vector()</tt> |
| 1991 |
without any arguments to use a default initial allocation (currently |
| 1992 |
10 elements). <tt>new Vector(<i>source</i>)</tt>, where <i>source</i> |
| 1993 |
is a list or another Vector, creates a Vector copy of the source |
| 1994 |
object using the source object's length as the initial allocation |
| 1995 |
size. (This change is meant to make the Vector programming interface |
| 1996 |
more consistent with the spirit of the class as a high-level, |
| 1997 |
automatic collection manager. The old requirement to specify what |
| 1998 |
amounts to an optimization parameter for every Vector was rather out |
| 1999 |
of character with this spirit.) |
| 2000 |
|
| 2001 |
<li>Most of the List and Vector methods that take an index value |
| 2002 |
arguments now accept negative index values to count backwards from the |
| 2003 |
last element: -1 is the last element, -2 is the second to last, and so |
| 2004 |
on. For methods that insert elements, 0 generally counts as one past |
| 2005 |
the last element, to insert after the last existing element. See the |
| 2006 |
individual List and Vector method descriptions for details. Note that |
| 2007 |
this works only with method calls, not with the <tt>[ ]</tt> subscript |
| 2008 |
operator. |
| 2009 |
|
| 2010 |
<li>The built-in functions max() and min() now accept a single list, |
| 2011 |
vector, or other list-like object value as the argument. The result |
| 2012 |
is the highest or lowest value in the list. |
| 2013 |
|
| 2014 |
<li>List has four new methods for finding minimum and maximum |
| 2015 |
elements, optionally applying a mapping function to the element values |
| 2016 |
to be minimized or maximized. indexOfMin() returns the index of the |
| 2017 |
element with the minimum value; minVal() returns the minimum element |
| 2018 |
value; indexOfMax() returns the index of the element with the maximum |
| 2019 |
value; maxVal() returns the maximum element value. With no |
| 2020 |
arguments, these methods all simply compare the element values |
| 2021 |
directly, and minVal() and maxVal() return the lowest/highest |
| 2022 |
element value. These methods can all optionally take one argument |
| 2023 |
giving a function pointer. If the function argument is supplied, the |
| 2024 |
methods call the function for each element in the list, passing the |
| 2025 |
element's value as the argument to the callback function, and the |
| 2026 |
methods all use the return value of the function in place of the |
| 2027 |
element value. For example, if lst is a list of string values, |
| 2028 |
lst.maxVal({x: x.length()}) returns the length of the longest string |
| 2029 |
in the list. |
| 2030 |
|
| 2031 |
<p>Vector has the same four new methods. |
| 2032 |
|
| 2033 |
<li>The File object has a new pair of methods, packBytes() and |
| 2034 |
unpackBytes(), that make it much easier to work with raw binary files, |
| 2035 |
especially files in third-party or standard formats such as JPEG or |
| 2036 |
MP3. The new methods convert between bytes in a file and TADS |
| 2037 |
datatypes in your program, using a mini-language that can express |
| 2038 |
complex data structures very compactly. This is based on the similar |
| 2039 |
facility in Perl and php, so if you're familiar with one of those |
| 2040 |
you'll already know the basics. ByteArray and String have their own |
| 2041 |
versions of the methods as well, for times when you want to prepare |
| 2042 |
byte structures in memory rather than in a file. For details, see <a |
| 2043 |
href="sysman/pack.htm">Byte Packing</a> in the System Manual. |
| 2044 |
|
| 2045 |
<li>A new static (class-level) File method, File.getRootName(), |
| 2046 |
extracts the "root" portion of a filename string. This is the portion |
| 2047 |
of the filename that excludes any directory or folder path prefix. |
| 2048 |
For example, given a string 'a/b/c.txt' while running on a Unix |
| 2049 |
machine, the function returns 'c.txt'. The function uses the correct |
| 2050 |
local naming rules for the OS that the program is actually running on. |
| 2051 |
|
| 2052 |
<li>In File.openTextFile() and File.openTextResource(), if the |
| 2053 |
character set isn't specified (because the parameter is missing or |
| 2054 |
nil), the default is now the system's default local character set for |
| 2055 |
file contents. This is the same character that |
| 2056 |
getLocalCharSet(CharsetFileCont) returns. In the past, the default |
| 2057 |
was always "us-ascii". Another small enhancement is that the |
| 2058 |
character set parameter can now be given as nil, which explicitly |
| 2059 |
selects the default (in the past, if you wanted the default, you had |
| 2060 |
to omit the parameter entirely). |
| 2061 |
|
| 2062 |
<li>A new static (class-level) File method, File.deleteFile(), lets |
| 2063 |
you delete files. The file safety level for write mode applies to |
| 2064 |
deletions, so you can only delete a file that you could also |
| 2065 |
overwrite. |
| 2066 |
|
| 2067 |
<li>File.writeBytes() now accepts a File object as the source of |
| 2068 |
the data to write to the file. This makes it easy to copy a portion |
| 2069 |
of one file to another file. When the source is a File object, |
| 2070 |
the <i>start</i> parameter specifies a seek location in the source |
| 2071 |
file; if <i>start</i> is omitted or nil, the default starting location |
| 2072 |
is the current seek location in the file. |
| 2073 |
|
| 2074 |
<li>A new File method, setMode(), lets you change the data mode of an |
| 2075 |
open file. |
| 2076 |
|
| 2077 |
<li>In the past, File.getPos() wasn't reliable when reading from text |
| 2078 |
files. The File object internally buffers text read from the file so |
| 2079 |
that it can perform character set conversions, and getPos() was |
| 2080 |
incorrectly returning the position of the last byte read into the |
| 2081 |
internal buffer, rather than the read position within the buffer. |
| 2082 |
This made it impossible to reliably seek back to a starting location |
| 2083 |
in the middle of a series of text reads. This is now fixed. |
| 2084 |
|
| 2085 |
<li>Reading from a file opened in one of the read/write access modes |
| 2086 |
(FileAccessReadWriteKeep, FileAccessReadWriteTrunc) didn't work in |
| 2087 |
past versions; it could cause a crash. This has been corrected. |
| 2088 |
|
| 2089 |
<li>The File methods that open resource files are now affected by the |
| 2090 |
file safety level. If a resource isn't bundled into the .t3 file, the |
| 2091 |
open-resource methods traditionally looked for the resource as a |
| 2092 |
separate, unbundled file within the image file's folder. They now do |
| 2093 |
this <b>only if</b> the file safety level would allow access to the |
| 2094 |
same file through a regular open-file method. This makes it |
| 2095 |
especially important for you to explicitly bundle any resources |
| 2096 |
directly into the .t3 file, since bundled resources are always |
| 2097 |
accessible, regardless of file safety settings. |
| 2098 |
|
| 2099 |
<li>The new intrinsic class <a |
| 2100 |
href="sysman/tempfile.htm">TemporaryFile</a> provides support for |
| 2101 |
temporary files in the local file system. A temporary file is a file |
| 2102 |
that only exists for the duration of the program's execution, and is |
| 2103 |
automatically deleted when the program exits. You can manipulate |
| 2104 |
temporary files even when the file safety level prohibits access to |
| 2105 |
the local file system, because their inherent limitations prevent |
| 2106 |
misuse by malicious programs. |
| 2107 |
|
| 2108 |
<p>Use <tt>new TemporaryFile()</tt> to create a TemporaryFile object. |
| 2109 |
The system automatically assigns the new object a unique filename in |
| 2110 |
the local file system, typically in a special system directory |
| 2111 |
designated by the operating system. You don't specify the name of a |
| 2112 |
temporary file, since the system chooses the name for you to ensure |
| 2113 |
uniqueness. Creating the TemporaryFile object doesn't actually create |
| 2114 |
a file on disk; it merely generates a filename that you can use. You |
| 2115 |
can then create, read, write, and otherwise manipulate the actual file |
| 2116 |
using the File object. Pass the TemporaryFile object in place of the |
| 2117 |
filename string to open the file. You can also use TemporaryFile |
| 2118 |
objects in most other system functions that operate on files |
| 2119 |
(saveGame(), restoreGame(), setLogFile(), scriptScriptFile(), and |
| 2120 |
logConsoleCreate()). |
| 2121 |
|
| 2122 |
|
| 2123 |
<li>The file safety level is now separated into two components, one |
| 2124 |
for reading files and the other for writing files. The safety levels |
| 2125 |
have the same meanings as in past versions, but you can now select the |
| 2126 |
read and write levels separately by specifying two digits in the |
| 2127 |
<tt>-s</tt> option. The first digit is the read level, and the second |
| 2128 |
is the write level. For example, <tt>-s04</tt> allows all read |
| 2129 |
access, but blocks all write access. If you specify only one digit, |
| 2130 |
the given level is applied to both read and write operations, so |
| 2131 |
the option works the same way it used to if you use the old syntax. |
| 2132 |
The default is still <tt>-s2</tt>, which allows read and write access |
| 2133 |
to the directory containing the image file, and denies all other file |
| 2134 |
access. |
| 2135 |
|
| 2136 |
<li>The file safety levels that restrict access to the image file |
| 2137 |
directory now consider files within subdirectories of that directory |
| 2138 |
to be within that directory. In the past this was ambiguous, although |
| 2139 |
most systems considered only allowed access to files directly in the |
| 2140 |
image file directory. It makes more sense to allow subdirectory |
| 2141 |
access than to forbid it: subdirectories are conceptually contained |
| 2142 |
within their parent directory, so access within subdirectories is |
| 2143 |
still effectively sandboxed to the containing directory. |
| 2144 |
|
| 2145 |
<li>Saved game files can now include an optional "metadata" table, |
| 2146 |
containing game-defined descriptive information about the state of the |
| 2147 |
game at the time of creating the save file. This can include any |
| 2148 |
information the game wishes to include, such as the current room |
| 2149 |
location, score, number of turns, chapter number, etc. The |
| 2150 |
interpreter and other tools can extract this information and display |
| 2151 |
it to the user when browsing a collection of saved game files, to help |
| 2152 |
jog the user's memory about the game position saved in the file. See |
| 2153 |
<a href="sysman/tadsgen.htm#saveGame">saveGame()</a> in the System |
| 2154 |
Manual for details. |
| 2155 |
|
| 2156 |
<li>The setLogFile() and setScriptFile() built-in functions now return |
| 2157 |
values, to indicate success or failure. On success, the functions |
| 2158 |
return true; on failure, they return nil. A failure result from |
| 2159 |
setLogFile() means that the specified file can't be created, and from |
| 2160 |
setScriptFile() it means the file doesn't exist or can't be opened. |
| 2161 |
|
| 2162 |
<li>The new IntrinsicClass static method isIntrinsicClass() lets you |
| 2163 |
determine if a given object is an IntrinsicClass instance. This isn't |
| 2164 |
possible using ofKind() or getSuperclassList(), because those methods |
| 2165 |
work within the <i>inheritance</i> class tree for the intrinsic types. |
| 2166 |
This new method is required to make this determination. |
| 2167 |
IntrinsicClass is only used for the <i>representation</i> of an |
| 2168 |
intrinsic class, and isn't involved in the inheritance structure. |
| 2169 |
For more information, see the <a href="sysman/icic.htm">IntrinsicClass</a> |
| 2170 |
documentation. |
| 2171 |
|
| 2172 |
<li>You can now enter expressions containing anonymous functions |
| 2173 |
interactively in the debugger (such as in the "Watch" list, breakpoint |
| 2174 |
conditions, or the expression evaluation dialog). This wasn't |
| 2175 |
allowed in the past. |
| 2176 |
|
| 2177 |
<li>The debugger now shows the contents of a Vector in-line when you |
| 2178 |
inspect its value, just like a list. This saves you the trouble of |
| 2179 |
using the "+" box in the watch window every time you want to look at a |
| 2180 |
small vector's contents. You can still use the "+" box as usual, but |
| 2181 |
when a vector only has a few elements, the in-line display is usually |
| 2182 |
all you'll need. |
| 2183 |
|
| 2184 |
<li>The debugger now makes it easy to view the contents of a |
| 2185 |
LookupTable. First, when a LookupTable value is displayed in a |
| 2186 |
tooltip or in a watch window, the list of keys and values is displayed |
| 2187 |
using the new <tt>[key->value]</tt> list notation. Second, when |
| 2188 |
inspecting a lookup table object in a watch window, you can now click |
| 2189 |
the "+" symbol to inspect the list of key/value pairs stored in the |
| 2190 |
table. |
| 2191 |
|
| 2192 |
<li>The debugger now shows the original pattern string in-line |
| 2193 |
when inspecting a variable containing a RexPattern object. |
| 2194 |
|
| 2195 |
<li>When rand() is used with multiple arguments, it now only evaluates |
| 2196 |
the one randomly chosen argument value. This means that side effects |
| 2197 |
will only be triggered for the chosen argument, and not for any of the |
| 2198 |
other arguments. This is useful because it means that you can use |
| 2199 |
rand() to intentionally trigger a randomly selected side effect. |
| 2200 |
For example: <tt>rand("one", "two", "three", "four", "five")</tt> prints |
| 2201 |
out a randomly selected number from one to five, and |
| 2202 |
<tt>rand(f(x), g(x), h(x))</tt> randomly calls one of the functions |
| 2203 |
f(), g(), or h(). |
| 2204 |
|
| 2205 |
<li>The rand() function can now generate a random string based on a |
| 2206 |
template string. When rand() is called with a single string argument, |
| 2207 |
the function returns a string of random characters chosen according to |
| 2208 |
the template. See the <a href="sysman/tadsgen.htm#rand">rand()</a> |
| 2209 |
documentation for details. |
| 2210 |
|
| 2211 |
<li>The interpreter now automatically seeds the random number |
| 2212 |
generator at the start of the run. In the past, it was up to the |
| 2213 |
program to do this by explicitly calling the randomize() function. |
| 2214 |
The reason for changing the default is that defaults in general should |
| 2215 |
be the settings most people would want most of the time, and in this |
| 2216 |
case that's clearly automatic randomizing. The only time you'd want |
| 2217 |
<i>not</i> to randomize is during regression testing, when you want to |
| 2218 |
verify that the program runs exactly the same way every time. When |
| 2219 |
you do want a repeatable random number sequence, specify the new |
| 2220 |
<tt>-norand</tt> interpreter option: <tt>t3run -norand mygame.t3</tt> |
| 2221 |
|
| 2222 |
<li>A new BigNumber method, numType(), returns information on the type |
| 2223 |
of value represented by the BigNumber. This allows you to identify |
| 2224 |
the special distinguished values "Not a Number" (NaN) and positive and |
| 2225 |
negative infinity. |
| 2226 |
|
| 2227 |
<li>A few new BigNumber.formatString() flags have been added: |
| 2228 |
BignumCompact (use the more compact of the regular format or |
| 2229 |
scientific notation); BignumMaxSigDigits (count only significant |
| 2230 |
digits against the maxDigits limit, not leading zeros); |
| 2231 |
BignumKeepTrailingZeros (keep trailing zeros after the decimal point |
| 2232 |
to fill out the result to maxDigits in length). |
| 2233 |
|
| 2234 |
<li>toString() now respects the radix argument for BigNumber values |
| 2235 |
that are whole integers. |
| 2236 |
|
| 2237 |
<li>toString() accepts a new "isSigned" argument that lets you control |
| 2238 |
whether a signed or unsigned interpretation should be used for integer |
| 2239 |
values. In the past, this was tied to radix - decimal treated values |
| 2240 |
as signed, any other radix as unsigned. The default is the same |
| 2241 |
as before, but you can now override it to get an unsigned decimal |
| 2242 |
representation, or a signed hex representation, for example. |
| 2243 |
|
| 2244 |
<li>toInteger() now accepts any radix from 2 to 36. The letters A |
| 2245 |
through Z represent digit values 10 through 35 for bases above 10, in |
| 2246 |
analogy to hexadecimal notation. For better consistency with its |
| 2247 |
name, the function also now converts the strings "true" and "nil" |
| 2248 |
respectively to 1 and 0 (instead of the boolean true and nil values |
| 2249 |
that it formerly returned), and converts the boolean values true and |
| 2250 |
nil to 1 and 0. It's also a little more liberal about parsing strings |
| 2251 |
containing the text "true" or "nil", in that it now ignores leading |
| 2252 |
and trailing spaces. |
| 2253 |
|
| 2254 |
<li>The new function <a |
| 2255 |
href="sysman/tadsgen.htm#toNumber">toNumber()</a> is similar to |
| 2256 |
toInteger(), but also parses strings representing BigNumber values. |
| 2257 |
If the input is a string representing a floating point value (i.e., it |
| 2258 |
has a decimal point or uses the 'E' exponential format), or an |
| 2259 |
integer that's too large for an ordinary 32-bit TADS integer, the |
| 2260 |
value is returned as a BigNumber. If it's a whole number that fits in |
| 2261 |
a 32-bit integer, it's returned as an integer. This routine can also |
| 2262 |
be used to parse a BigNumber integer value in a non-decimal radix. |
| 2263 |
|
| 2264 |
<li>The compiler now pays attention to resource file timestamps in |
| 2265 |
determining whether it needs to rebuild the image file. In the past, |
| 2266 |
merely updating a resource file didn't trigger a relink, so the image |
| 2267 |
wouldn't be updated with a new resource until it was relinked for some |
| 2268 |
other reason. |
| 2269 |
|
| 2270 |
<li>The new "if-nil" operator <a href="sysman/expr.htm#ifnil"><tt>??</tt></a> |
| 2271 |
checks an expression to |
| 2272 |
see if the value is nil, and if so yields a default value. |
| 2273 |
<tt>a ?? b</tt> yields <i>a</i> if <i>a</i> is not nil, otherwise |
| 2274 |
it yields <i>b</i>. This is a concise and efficient (in terms |
| 2275 |
of code size and execution time) way to write a default value |
| 2276 |
substitution, which is a common situation when using argument |
| 2277 |
values from callers, property values set elsewhere in the code, |
| 2278 |
and function and method call results. |
| 2279 |
|
| 2280 |
<li>The new operator <tt>>>></tt> performs a logical right |
| 2281 |
shift. Furthermore, the existing <tt>>></tt> operator is now |
| 2282 |
explicitly defined as performing an arithmetic right shift. In the |
| 2283 |
past, it wasn't specified whether <tt>>></tt> performed an |
| 2284 |
arithmetic or logical shift, although in practice all existing |
| 2285 |
implementations (as far as we know) performed an arithmetic shift, so |
| 2286 |
existing programs shouldn't see any change. |
| 2287 |
|
| 2288 |
<p>The difference between the arithmetic and logical right shift is |
| 2289 |
the treatment of the vacated high-order bits. A logical right shift |
| 2290 |
fills all vacated bits with zeros, whereas an arithmetic right shift |
| 2291 |
fills the vacated bits with the original high-order bit of the left |
| 2292 |
operand. Arithmetic shifts are so named because copying the |
| 2293 |
high-order bit preserves the sign of the original value. |
| 2294 |
|
| 2295 |
<p>The <tt>>>></tt> operator isn't purely a TADS invention. |
| 2296 |
Java and Javascript define it the same way TADS does, and likewise |
| 2297 |
specify that <tt>>></tt> performs an arithmetic shift. |
| 2298 |
|
| 2299 |
<li>Many of the standard bundled character sets now recognize a number |
| 2300 |
of name variations, based on naming conventions used in various other |
| 2301 |
programming languages and applications. They're meant to make the |
| 2302 |
character mapper a little easier to use by letting you use names that |
| 2303 |
you might be accustomed to using from other systems, rather than |
| 2304 |
having to remember a separate naming scheme for TADS. The new |
| 2305 |
variations (which are all insensitive to upper/lower case) are: |
| 2306 |
|
| 2307 |
<ul> |
| 2308 |
<li>Latin-X: In the past, these had to be called "isoN", |
| 2309 |
as in "iso2" for Latin-2. The mapper now also accepts |
| 2310 |
Latin2, Latin-2, ISO-2, 8859-2, ISO8859-2, ISO-8859-2, ISO_8859-2, |
| 2311 |
ISO_8859_2, and L2. (Likewise for Latin-3, Latin-4, etc.) |
| 2312 |
|
| 2313 |
<li>Windows and DOS code pages: The old name was "cpXXX", where |
| 2314 |
XXX is the code page number, as in "cp1252". The mapper now also |
| 2315 |
accepts just plain 1252, as well as win1252, win-1252, windows1252, |
| 2316 |
windows-1252, dos1252, and dos-1252. |
| 2317 |
|
| 2318 |
<li>UCS-2LE: The little-endian 16-bit Unicode character sets can also |
| 2319 |
be called UCS2LE, UTF-16LE, UTF16LE, UTF_16LE, UnicodeL, Unicode-L, |
| 2320 |
and Unicode-LE. |
| 2321 |
|
| 2322 |
<li>UCS-2BE: The big-endian 16-bit Unicode character sets can also |
| 2323 |
be called UCS2BE, UTF-16BE, UTF16BE, UTF_16BE, UnicodeB, Unicode-B, |
| 2324 |
and Unicode-BE. |
| 2325 |
</ul> |
| 2326 |
|
| 2327 |
<li>BigNumber now uses the standard "round to nearest, ties to even" |
| 2328 |
rule whenever rounding occurs, including calculation results and |
| 2329 |
explicit rounding requests. This is the rounding method that most |
| 2330 |
computer floating point systems use, because it's considered the least |
| 2331 |
statistically biased. |
| 2332 |
|
| 2333 |
<p>The new rule is to round to the nearest digit, or to round to the |
| 2334 |
nearest <i>even</i> digit when exactly halfway between two digits. |
| 2335 |
For example, rounding 104.5 to integer yields 104: the value is |
| 2336 |
exactly halfway between 104 and 105, so we round to the nearest even |
| 2337 |
digit for a result of 104. Similarly, rounding 1.2345 to four digits |
| 2338 |
yields 1.234, since 1.2345 is exactly halfway between 1.234 and 1.235, |
| 2339 |
and the nearest even digit in last place is 4. |
| 2340 |
|
| 2341 |
<p>The <b>old</b> algorithm was <i>almost</i> identical: it was "round |
| 2342 |
to nearest, ties away from zero", which rounded to the next higher |
| 2343 |
absolute value when exactly halfway between digits. For example, |
| 2344 |
rounding 104.5 to integer formerly yielded 105, since we formerly |
| 2345 |
always rounded up from the halfway point. There's no change for |
| 2346 |
values that aren't exactly halfway between digits: rounding 102.5001 |
| 2347 |
or 103.4999 to integer both yield 103 under both the new and old |
| 2348 |
rules. |
| 2349 |
|
| 2350 |
<li>The console output formatter now renders embedded null characters |
| 2351 |
(Unicode value U+0000) as spaces. In the past, the formatter |
| 2352 |
considered a null to be the end of a string, which isn't consistent |
| 2353 |
with TADS string semantics. |
| 2354 |
|
| 2355 |
<li>The compiler is less conservative than it used to be about a |
| 2356 |
certain optimization involving anonymous functions. In the past, |
| 2357 |
every anonymous function expression triggered the creation of an |
| 2358 |
AnonFuncPtr object. This object contains the anonymous function's |
| 2359 |
context: the local variables and "self" from its enclosing code block. |
| 2360 |
However, many anonymous functions are entirely self-contained, meaning |
| 2361 |
they don't make any reference to their enclosing contexts. These |
| 2362 |
don't actually need a context object, since they have no dependency on |
| 2363 |
anything that would go in it. There's a slight performance cost to |
| 2364 |
creating the context object, so the compiler now creates one only when |
| 2365 |
it's actually needed. |
| 2366 |
|
| 2367 |
<p>This change should be <i>almost</i> invisible to game code. It's |
| 2368 |
possible to detect if you're looking for it by checking the dataType() |
| 2369 |
of an anonymous function value: it was formerly always TypeObject, but |
| 2370 |
now it can also be TypeFuncPtr, for cases where no context object is |
| 2371 |
needed. Other than this (and a slight speed improvement), the change |
| 2372 |
should be transparent. |
| 2373 |
|
| 2374 |
<li>It's now possible to break out of an infinite loop if you should |
| 2375 |
happen to get stuck in one evaluating an expression within the |
| 2376 |
debugger. The debugger already let you break into normal program |
| 2377 |
execution that was stuck looping, using a platform-defined keystroke |
| 2378 |
or other UI action (on Windows, for example, the Workbench debugger |
| 2379 |
uses the key combination Ctrl+Break). The same thing now works if you |
| 2380 |
evaluate a debugger expression that gets stuck in a loop. (In the |
| 2381 |
past, the debugger ignored the "break" command while it already had |
| 2382 |
control. It now interrupts the expression by throwing an error.) |
| 2383 |
|
| 2384 |
(<a href="http://bugdb.tads.org/view.php?id=0000093">bugdb.tads.org #0000093</a>) |
| 2385 |
|
| 2386 |
<li>In past versions, the StringComparator object didn't save its list |
| 2387 |
of character equivalence mappings properly to the image file or to |
| 2388 |
saved game files. This caused character mappings to be lost |
| 2389 |
(corrupted, actually, but for practical purposes lost) when they were |
| 2390 |
made during preinit, or when restoring a game where a StringComparator |
| 2391 |
with mappings had been created dynamically. This has been corrected. |
| 2392 |
|
| 2393 |
(<a href="http://bugdb.tads.org/view.php?id=0000085">bugdb.tads.org #0000085</a>) |
| 2394 |
|
| 2395 |
|
| 2396 |
<li>The multi-method inherited() operator didn't work properly if used |
| 2397 |
within a function that was replaced by another function using the |
| 2398 |
"modify" statement. This is now fixed. |
| 2399 |
|
| 2400 |
<li>A bug in the compiler sometimes caused a crash in a rare situation |
| 2401 |
involving a link-time symbol conflict (in particular, the same symbol |
| 2402 |
defined as a <tt>grammar</tt> rule in one module and a different type |
| 2403 |
in another module). This has been corrected. |
| 2404 |
|
| 2405 |
<li>A bug in the regular expression search functions prevented |
| 2406 |
matching zero-length expressions at the end of the subject string. |
| 2407 |
For example, searching for <tt>'x*$'</tt> correctly matched 'uvwx' |
| 2408 |
(with a match length of 1), but not 'uvw' (which <i>should</i> match |
| 2409 |
with a length of 0). This has been fixed. |
| 2410 |
|
| 2411 |
<li>A regular expression bug caused incorrect results to be returned |
| 2412 |
for capturing groups for certain complex expression types. This |
| 2413 |
was triggered by an expression with two wildcard closures preceding |
| 2414 |
a capturing group preceding some fixed text. This is now fixed. |
| 2415 |
|
| 2416 |
(<a href="http://bugdb.tads.org/view.php?id=0000088">bugdb.tads.org #0000088</a>) |
| 2417 |
|
| 2418 |
<li>In past versions of the text-only interpreters, if an |
| 2419 |
<ABOUTBOX> section contained an <IMG> tag with an ALT |
| 2420 |
attribute, the ALT text was displayed. It shouldn't have been, |
| 2421 |
because the text-only systems aren't supposed to display |
| 2422 |
<i>anything</i> that's within an <ABOUTBOX> section. This has |
| 2423 |
been corrected. |
| 2424 |
|
| 2425 |
(<a href="http://bugdb.tads.org/view.php?id=0000063">bugdb.tads.org #0000063</a>) |
| 2426 |
|
| 2427 |
<li>The text-only interpreters now parse and translate HTML |
| 2428 |
entity markups ("&" sequences) within <TITLE> tags when |
| 2429 |
setting the window title. (In past versions, the text-only |
| 2430 |
interpreters simply displayed the literal text of the & |
| 2431 |
sequences. The HTML interpreters didn't have this problem, |
| 2432 |
so this change doesn't affect them.) |
| 2433 |
|
| 2434 |
(<a href="http://bugdb.tads.org/view.php?id=0000062">bugdb.tads.org #0000062</a>) |
| 2435 |
|
| 2436 |
<li>The bug fix in 3.0.18 for newline translation in UTF-16 text files |
| 2437 |
introduced another bug, which corrupted output text when calling |
| 2438 |
writeFile() with a string containing embedded newline ('\n') characters. |
| 2439 |
This has been corrected. |
| 2440 |
|
| 2441 |
(<a href="http://bugdb.tads.org/view.php?id=0000065">bugdb.tads.org #0000065</a>) |
| 2442 |
|
| 2443 |
<li><a name="compoundAsiSideEffects"></a>The compiler formerly |
| 2444 |
generated code that was arguably incorrect for a compound assignment |
| 2445 |
expression containing side effects in the lvalue. In the past, |
| 2446 |
the compiler effectively expanded an expression of the form |
| 2447 |
<i>lvalue op= rvalue</i> into <i>lvalue = lvalue op rvalue</i>. For |
| 2448 |
example, "a += b" became "a = a + b". In most cases this is fine, but |
| 2449 |
when the lvalue contains side effects, it results in two evaluations |
| 2450 |
of the side effects. For example, "lst[i++] += 1" incremented "i" |
| 2451 |
twice. For a really complex expression like "lst[i++][j++][k++] += |
| 2452 |
2", the "i++" side effect was triggered even more times, because |
| 2453 |
it contains multiple implied lvalues. |
| 2454 |
|
| 2455 |
<p>The correct behavior is to evaluate each subexpression in the |
| 2456 |
lvalue only once. The compiler now generates code that does just this. |
| 2457 |
|
| 2458 |
<p>The old behavior was only <i>arguably</i> wrong, in that the |
| 2459 |
correct behavior wasn't really specified anywhere. But to the extent |
| 2460 |
that TADS doesn't fully specify its expression behavior, |
| 2461 |
it's reasonable to expect |
| 2462 |
that TADS should behave like C++. C++ does have well-defined |
| 2463 |
semantics for this situation, which the new behavior matches. |
| 2464 |
Plus, the new behavior is in line |
| 2465 |
with the obvious reading of an <i>op</i>= expression: the lvalue is |
| 2466 |
only mentioned once in such an expression, suggesting that it should |
| 2467 |
only be evaluated once. |
| 2468 |
|
| 2469 |
<li>A bug in the debugger caused a crash under rare circumstances. |
| 2470 |
The problem happened when a run-time error occurred within a callback |
| 2471 |
function being invoked from certain built-in functions or methods, and |
| 2472 |
you then terminated the program via the debugger UI while execution |
| 2473 |
was still suspended at the error location. This is now fixed. |
| 2474 |
|
| 2475 |
<li>A bug in the Vector intrinsic class caused rare, random crashes |
| 2476 |
under certain conditions when calling mapAll(). The crashes were most |
| 2477 |
likely with very large vectors, and only when the callback function |
| 2478 |
could trigger garbage collection (such as by creating a new object). |
| 2479 |
This has been fixed. |
| 2480 |
|
| 2481 |
<li>A bug in the BigNumber class caused inaccurate results for expE(), |
| 2482 |
raiseToPower(), sinh(), cosh(), and tanh() for certain values. The |
| 2483 |
problem only affected a limited (but difficult to characterize) range |
| 2484 |
of input values. For affected values, the results were still correct |
| 2485 |
to about 17 decimal places; the inaccuracy appeared starting at about |
| 2486 |
the 18th decimal place, so it would only have been noticeable in |
| 2487 |
applications requiring relatively high precisions. For example, a |
| 2488 |
program that would have been happy with the standard C "double" type |
| 2489 |
wouldn't have noticed the bug, because the typical C double provides |
| 2490 |
only about 15 decimal digits of precision. The problem is now fixed. |
| 2491 |
|
| 2492 |
<li>In past versions, the ByteArray object didn't save undo |
| 2493 |
information for File.readBytes() or ByteArray.writeInt() operations. |
| 2494 |
It now saves the undo. |
| 2495 |
|
| 2496 |
<li class=last>The compiler incorrectly reported internal errors for assignments |
| 2497 |
to objects, functions, and other global symbol names. The compiler now |
| 2498 |
shows a regular error message instead for this type of error. |
| 2499 |
|
| 2500 |
(<a href="http://bugdb.tads.org/view.php?id=0000071">bugdb.tads.org #0000071</a>) |
| 2501 |
|
| 2502 |
</ul> |
| 2503 |
|
| 2504 |
|
| 2505 |
<h3>Changes for 3.0.18.1 (May 5, 2009)</h3> |
| 2506 |
|
| 2507 |
<ul> |
| 2508 |
|
| 2509 |
<li>The behavior of the multi-method inherited() operator has changed. |
| 2510 |
The operator now chooses the inherited function to call based on the |
| 2511 |
actual argument values, rather than the formal (declared) parameters |
| 2512 |
to the current function. This is more consistent with the inherited() |
| 2513 |
operator for regular methods. |
| 2514 |
|
| 2515 |
<li class=last>A bug in the compiler, versions 3.0.17, 3.0.17.1, and 3.0.18, |
| 2516 |
caused incorrect (too small) stack size requests to be generated for |
| 2517 |
some functions and methods. This generally had no noticeable effect |
| 2518 |
on valid programs, but it made it possible for an errant program (with |
| 2519 |
infinite recursion, for example) to cause a stack overflow that the |
| 2520 |
interpreter doesn't detect immediately, which could conceivably crash |
| 2521 |
the interpreter. An actual crash would require an unlikely |
| 2522 |
combination of factors, even with an errant program compiled with this |
| 2523 |
bug, so you'll probably never notice it. Even so, if you distributed |
| 2524 |
any .t3 files compiled with t3make versions 3.0.17 through 3.0.18, we |
| 2525 |
recommend recompiling with the current t3make version and replacing |
| 2526 |
your previously distributed files, if it's easy for you to do so. |
| 2527 |
|
| 2528 |
</ul> |
| 2529 |
|
| 2530 |
|
| 2531 |
|
| 2532 |
<h3>Changes for 3.0.18 (April 28, 2009)</h3> |
| 2533 |
|
| 2534 |
<ul> |
| 2535 |
|
| 2536 |
<li>The <tt>inherited</tt> operator can now be used within a multi-method |
| 2537 |
to inherit an overridden version of the method. The new syntax |
| 2538 |
<tt>inherited<<i>type-list</i>>(<i>arg-list</i>)</tt> lets you |
| 2539 |
inherit a specific version of the multi-method, while the basic syntax |
| 2540 |
<tt>inherited(<i>arg-list</i>)</tt> automatically selects the next |
| 2541 |
more general version of the multi-method. See the System Manual |
| 2542 |
section on multi-methods for documentation. |
| 2543 |
|
| 2544 |
<li>The compiler pre-defines the new preprocessor symbol (i.e., macro) |
| 2545 |
__TADS3, which expands simply to the number 1. This provides an easy |
| 2546 |
way to detect that the compiler is a TADS 3 compiler (as opposed to a |
| 2547 |
TADS 2 compiler) for conditional compilation purposes. (This might |
| 2548 |
seem redundant with the existing symbol __TADS_SYSTEM_MAJOR, but |
| 2549 |
__TADS3 can be used in one way that __TADS_SYSTEM_MAJOR can't. If for |
| 2550 |
some reason you wanted to create a single source file that could be |
| 2551 |
compiled under TADS 2 or TADS 3, using conditional compilation to |
| 2552 |
handle the syntax differences between the language versions, you |
| 2553 |
couldn't do it with __TADS_SYSTEM_MAJOR. This is because TADS 2 |
| 2554 |
doesn't support #if, which is the only way you could use |
| 2555 |
__TADS_SYSTEM_MAJOR to conditionally compile based on compiler version |
| 2556 |
(e.g., <tt>#if __TADS_SYSTEM_MAJOR == 3</tt>). Since TADS 2 and 3 |
| 2557 |
both support #ifdef, though, you can use the presence or absence of |
| 2558 |
the __TADS3 symbol to conditionally include or omit code based on |
| 2559 |
language version. Of course, since older versions of the TADS 3 |
| 2560 |
compiler also lack this symbol, this approach requires using 3.0.17.2 |
| 2561 |
or later on the TADS 3 side.) |
| 2562 |
|
| 2563 |
<li>In past versions, writing to text files with a UTF-16 encoding |
| 2564 |
generated incorrect newline sequences when running on Windows. The |
| 2565 |
problem had to do with the two-character representation of a newline |
| 2566 |
in Windows. This has been corrected. |
| 2567 |
|
| 2568 |
<li class=last>In the past, multi-methods defined in one source file and called |
| 2569 |
from another resulted in an "undefined symbol" error. This has been |
| 2570 |
corrected. |
| 2571 |
|
| 2572 |
</ul> |
| 2573 |
|
| 2574 |
|
| 2575 |
|
| 2576 |
<h3>Changes for 3.0.17.1 (8/12/2008)</h3> |
| 2577 |
|
| 2578 |
<ul> |
| 2579 |
|
| 2580 |
<li class=last><p>A compiler bug introduced in 3.0.17 caused Workbench (and the |
| 2581 |
stand-alone interpreter) to crash when loading certain games when |
| 2582 |
compiled for debugging. The compiler was mis-calculating some |
| 2583 |
internal data structure sizes, which effectively corrupted the .t3 |
| 2584 |
file; this happened when the byte code for a function plus its debug |
| 2585 |
symbols was over a certain threshold size. This has been corrected. |
| 2586 |
|
| 2587 |
</ul> |
| 2588 |
|
| 2589 |
|
| 2590 |
<h3>Changes for 3.0.17 (8/9/2008)</h3> |
| 2591 |
|
| 2592 |
<ul> |
| 2593 |
|
| 2594 |
<li><p>The compiler has a new feature called "multi-methods." This |
| 2595 |
implements a relatively new object-oriented programming technique |
| 2596 |
known as multiple dispatch, in which the types of <i>multiple</i> |
| 2597 |
arguments can be used to determine which of several possible functions |
| 2598 |
to call. The traditional TADS method call uses a |
| 2599 |
<i>single-dispatch</i> system: when you write "x.foo(3)", you're |
| 2600 |
invoking the method foo as defined on the object x, or as inherited |
| 2601 |
from the nearest superclass of x that defines that method. This is |
| 2602 |
known as single dispatch because a single value (x) controls the |
| 2603 |
selection of which definition of foo will be invoked. With multiple |
| 2604 |
dispatch, this notion is extended so that multiple values can be |
| 2605 |
considered when selecting which method to invoke. For example, you |
| 2606 |
could write one version of a function "putIn()" that operates on a |
| 2607 |
Thing and a Container, and another version of the same function that |
| 2608 |
operates on a Liquid and a Vessel, and the system will automatically |
| 2609 |
choose the correct version at run-time based on the types of |
| 2610 |
<i>both</i> arguments. This new system is described more fully |
| 2611 |
in the <i>System Manual</i>. |
| 2612 |
</p> |
| 2613 |
|
| 2614 |
<li><p>The compiler can now generate information in each object about the |
| 2615 |
source file where the object was defined. This new information is |
| 2616 |
stored in a new property, sourceTextGroup; this supplements the |
| 2617 |
existing sourceTextOrder property. Since the new information takes up |
| 2618 |
extra space in the compiled file, it's not generated by default. To |
| 2619 |
generate it, include the new compiler option "-Gstg" in your makefile |
| 2620 |
or command line, <i>or</i> place the directive <tt>#pragma |
| 2621 |
sourceTextGroup(on)</tt> directive in each source module where you |
| 2622 |
wish to generate the information. The #pragma lets you selectively |
| 2623 |
generate the information in specific source files, or even in specific |
| 2624 |
portions of specific source files: the corresponding directive |
| 2625 |
<tt>#pragma sourceTextGroup(off)</tt> lets you turn off the |
| 2626 |
information in a section where you don't need it.</p> |
| 2627 |
|
| 2628 |
<p>When you turn on sourceTextGroup generation, the compiler |
| 2629 |
automatically adds a sourceTextGroup property to each object, just as |
| 2630 |
it automatically adds a sourceTextOrder value. The sourceTextGroup |
| 2631 |
value is a reference to an anonymous object that the compiler |
| 2632 |
automatically creates. One such object is generated per source module |
| 2633 |
for which sourceTextGroup generation is activated. This object |
| 2634 |
contains two properties: sourceTextGroupName is a string giving the |
| 2635 |
name of the module, as it appeared in the compiler command line, |
| 2636 |
makefile (.t3m), or library (.tl) file; sourceTextGroupOrder is an |
| 2637 |
integer giving the relative order of the module among the list of |
| 2638 |
modules comprising the overall program. |
| 2639 |
</p> |
| 2640 |
|
| 2641 |
<p>sourceTextGroup is useful in cases where you want to establish the |
| 2642 |
order of appearance in source files among objects in multiple modules. |
| 2643 |
For a given object <tt>x</tt>, |
| 2644 |
<tt>x.sourceTextGroup.sourceTextGroupOrder</tt> gives you the relative |
| 2645 |
order within the overall build of the module where <tt>x</tt> was |
| 2646 |
defined, and <tt>x.sourceTextOrder</tt> gives you the relative order |
| 2647 |
of <tt>x</tt> among the objects defined within that module. Between |
| 2648 |
the two values, you can establish a linear ordering for all of the |
| 2649 |
statically defined objects in the entire program.</p> |
| 2650 |
|
| 2651 |
<li><p>The compiler now stores "links" to resource files in the .t3 file |
| 2652 |
when compiling in Debug mode. This makes it easier to test a game |
| 2653 |
that uses multimedia resources, by making the Build environment match |
| 2654 |
the Release environment more precisely.</p> |
| 2655 |
|
| 2656 |
<p>In the past, when building in Debug |
| 2657 |
mode, the compiler completely ignored multimedia resource files listed |
| 2658 |
in the "-res" section of the command line or makefile. This was by |
| 2659 |
design; the reasoning was that when you're compiling in Debug mode, |
| 2660 |
you'll only be running that copy on your development machine, within |
| 2661 |
your build environment, where all of the resource files are available |
| 2662 |
as local files; and since the files are all available as separate |
| 2663 |
local files anyway, we can make the compilation go faster by skipping |
| 2664 |
the step where we copy those files into the .t3 file.</p> |
| 2665 |
|
| 2666 |
<p>This worked |
| 2667 |
fine <i>most</i> of the time, but it didn't work in the occasional |
| 2668 |
case where the resource name is different from the corresponding local |
| 2669 |
file's name in the file system. One example is the Cover Art file, |
| 2670 |
which is always stored in the game under the resource name |
| 2671 |
".system/CoverArt.jpg", which is usually <i>not</i> the same name the |
| 2672 |
file has locally. This meant that if you tried to refer to such a |
| 2673 |
resource via HTML (such as with an <IMG> tag), the resource was |
| 2674 |
reported as missing when running the debug build.</p> |
| 2675 |
|
| 2676 |
<p>The new arrangement |
| 2677 |
fixes this problem without giving up the time savings. With the new |
| 2678 |
scheme, the compiler stores a <b>link</b> for each resource in the .t3 |
| 2679 |
file: this simply records the mapping from resource name to local |
| 2680 |
file name. The HTML renderer can then look up the appropriate local |
| 2681 |
file for each resource, including any resources that have special |
| 2682 |
names. As before, the actual contents of the resources are not |
| 2683 |
copied. |
| 2684 |
</p> |
| 2685 |
|
| 2686 |
<p>Note that none of this affects Release builds. The compiler has |
| 2687 |
always copied the full contents of all resources into the .t3 file |
| 2688 |
when doing a Release build, and continues to do so. Release builds |
| 2689 |
continue to be fully self-contained, so that you only have to |
| 2690 |
distribute the .t3 file to players, <i>not</i> the individual |
| 2691 |
graphics and sound files it refers to.</p> |
| 2692 |
|
| 2693 |
<li class=last><p>The compiler's status output didn't add a line break after each |
| 2694 |
resource files being added to the project, resulting in poorly formatted |
| 2695 |
displays. This has been corrected.</p> |
| 2696 |
|
| 2697 |
</ul> |
| 2698 |
|
| 2699 |
|
| 2700 |
|
| 2701 |
<h3>Changes for 3.0.16 (4/10/2008)</h3> |
| 2702 |
|
| 2703 |
<ul> |
| 2704 |
|
| 2705 |
<li>The Author's Kit installer now gives you an option to skip |
| 2706 |
creating the Windows file type associations for Workbench |
| 2707 |
(specifically, project (.t3m) files). |
| 2708 |
|
| 2709 |
<li>The main startup routine in the library now performs an explicit |
| 2710 |
garbage collection pass just before performing pre-initialization. In |
| 2711 |
most cases, this is unnecessary (and harmless, obviously, apart from |
| 2712 |
the added execution time required to perform the GC pass). However, |
| 2713 |
under a certain combination of conditions, it can be important. In |
| 2714 |
particular, it's important when a program is compiled so that preinit |
| 2715 |
is performed at run-time rather than compile-time (this is normally |
| 2716 |
the case for a "debug mode" build, but can be explicitly selected for |
| 2717 |
a release build as well), <i>and</i> the program has |
| 2718 |
pre-initialization code that performs global object loops. In such a |
| 2719 |
program, a RESTART would re-run preinit, which could then encounter |
| 2720 |
garbage objects still around from before the RESTART. The explicit GC |
| 2721 |
pass just before preinit ensures that preinit sees only reachable |
| 2722 |
objects in any global object loops it performs. |
| 2723 |
|
| 2724 |
<li>A bug in the ByteArray intrinsic class caused an interpreter crash |
| 2725 |
when copying exactly the full bounds of an array onto itself. This has |
| 2726 |
been corrected. |
| 2727 |
|
| 2728 |
<li>The rexReplace() intrinsic function got stuck in an infinite loop |
| 2729 |
when the pattern to be replaced matched zero characters of the subject |
| 2730 |
string. For example, a match pattern of "x*" is able to match any |
| 2731 |
number of "x" characters in a row, <i>including</i> zero of them. The |
| 2732 |
problem was that the function simply spun its wheels, repeatedly |
| 2733 |
finding the same zero-character match and replacing it over and over. |
| 2734 |
This no longer occurs: the function will apply each zero-character |
| 2735 |
replacement once only, and then move on to the next character of the |
| 2736 |
subject string before attempting a new match. |
| 2737 |
|
| 2738 |
<li>The rexSearch() and rexReplace() functions didn't properly take |
| 2739 |
into account "^" (start-of-string) pattern specifiers when a starting |
| 2740 |
offset for the search was explicitly specified. The functions |
| 2741 |
incorrectly considered "^" to match the start of the substring |
| 2742 |
starting at the given starting offset, whereas it should have only |
| 2743 |
matched the start of the entire string. In other words, "^" should |
| 2744 |
never match when the starting offset is greater than 1. This has been |
| 2745 |
corrected. |
| 2746 |
|
| 2747 |
<li>A bug in the t3DebugTrace() intrinsic function sometimes caused the |
| 2748 |
debugger to stop execution at the second line after the t3DebugTrace() |
| 2749 |
function, rather than at the next line. This happened if you used the |
| 2750 |
"Go" command to resume execution from the point where t3DebugTrace() |
| 2751 |
stopped, then encountered the same t3DebugTrace() call without any |
| 2752 |
intervening debugger activity. This has been corrected. |
| 2753 |
|
| 2754 |
<li>Comparing another object value to "self" in a global breakpoint |
| 2755 |
expression sometimes caused the debugger to crash in past versions. |
| 2756 |
This has been corrected. |
| 2757 |
|
| 2758 |
<li>In the past, the compiler returned a "success" indication to the |
| 2759 |
operating system shell as long as no error messages were displayed |
| 2760 |
during the compilation. This was incorrect in cases where the "treat |
| 2761 |
warnings as errors" option was enabled and one or more warning |
| 2762 |
messages were displayed; in these cases, the compiler should have |
| 2763 |
returned a "failure" indication to reflect the fact that warnings |
| 2764 |
count as full-fledged errors under this option setting. This has |
| 2765 |
been corrected. |
| 2766 |
|
| 2767 |
<li class=last>Applying toInteger() to BigNumber values near the |
| 2768 |
capacity limits of the 32-bit integer type, but not exceeding them, |
| 2769 |
sometimes produced spurious "numeric overflow" errors. In particular, |
| 2770 |
values over 2147483640 or under -2147483640 that needed to be rounded |
| 2771 |
up in their fractional parts (e.g., 2147483640.9) produced this |
| 2772 |
spurious error. This has been corrected. |
| 2773 |
|
| 2774 |
</ul> |
| 2775 |
|
| 2776 |
|
| 2777 |
|
| 2778 |
<h3>Changes for 3.0.15.3 (11/2/2007)</h3> |
| 2779 |
|
| 2780 |
<ul> |
| 2781 |
|
| 2782 |
<li>A bug in the compiler made it impossible to refer to items in |
| 2783 |
global scope (such as enum values or objects) in constant expressions |
| 2784 |
within anonymous functions. For example, it was impossible to use |
| 2785 |
an enum value or object name as a 'case' label in a 'switch' statement |
| 2786 |
within an anonymous function. This has been corrected. |
| 2787 |
|
| 2788 |
<li class=last>A bug in the GrammarProd intrinsic class caused incorrect results |
| 2789 |
in some cases for an empty production (i.e., a grammar rule consisting |
| 2790 |
of no tokens). The problem had to do with the way the empty |
| 2791 |
production figured its position in the input token list; since |
| 2792 |
enclosing levels in the match tree find their positions relative to |
| 2793 |
child nodes, the problem typically manifested itself by giving |
| 2794 |
incorrect token list positions for one or more match levels enclosing |
| 2795 |
an empty match. This is now fixed. |
| 2796 |
|
| 2797 |
</ul> |
| 2798 |
|
| 2799 |
|
| 2800 |
|
| 2801 |
<h3>Changes for 3.0.15.2 (9/13/2007)</h3> |
| 2802 |
|
| 2803 |
<ul> |
| 2804 |
|
| 2805 |
<li>The inputFile() function now makes some additional checks when the |
| 2806 |
filename is supplied by an active event script file. If the dialog |
| 2807 |
type is InFileOpen, the function checks to make sure the filename read |
| 2808 |
from the script refers to an existing file. If the dialog type is |
| 2809 |
InFileSave, and the named file doesn't already exist, the function |
| 2810 |
tries to create a dummy copy of the file; if that succeeds, the |
| 2811 |
function immediately deletes the dummy copy. The function also still |
| 2812 |
tests, as it did before, to make sure the file <i>doesn't</i> already |
| 2813 |
exist for InFileSave dialogs. If any of these tests fail, the |
| 2814 |
function warns the user about the problem and offers the same options |
| 2815 |
it did in the past for the save-overwrite case: use the filename as |
| 2816 |
given in the script, choose a different file, or cancel the script |
| 2817 |
playback. |
| 2818 |
|
| 2819 |
<li class=last>A bug in the VM caused sporadic, unpredictable errors when |
| 2820 |
finalizers were used. The problem affected one opcode (OPCGETPROPR0); |
| 2821 |
if a finalizer invocation happened to interrupt this particular |
| 2822 |
opcode, the result was unpredictable, but could include spurious |
| 2823 |
run-time errors or corruptions of calculated results. This has been |
| 2824 |
corrected. |
| 2825 |
|
| 2826 |
</ul> |
| 2827 |
|
| 2828 |
|
| 2829 |
|
| 2830 |
|
| 2831 |
<h3>Changes for 3.0.15.1 (7/19/2007)</h3> |
| 2832 |
|
| 2833 |
<ul> |
| 2834 |
|
| 2835 |
<li>The keyword <tt>replaced</tt> can now be used within anonymous |
| 2836 |
functions that are nested in modifier functions (i.e., functions |
| 2837 |
defined with <tt>modify <i>funcname</i> ...</tt>). In the past, the |
| 2838 |
compiler only allowed <tt>replaced</tt> to be used <b>directly</b> |
| 2839 |
within a modifier function - not in nested anonymous functions defined |
| 2840 |
within a modifier function. There's no inherent reason for |
| 2841 |
disallowing this construct; it was simply a limitation of the |
| 2842 |
compiler, which has now been lifted. |
| 2843 |
|
| 2844 |
<li>In the system library, the several internal convenience macros |
| 2845 |
defined with the Tokenizer class (tokRuleName, tokRulePat, |
| 2846 |
tokRuleType, etc) have been moved from the tok.t class file to the |
| 2847 |
tok.h header file. The macros are unchanged, so this change won't |
| 2848 |
affect existing code. The macros were formerly defined in tok.t |
| 2849 |
rather than in the header because they were meant as private macros |
| 2850 |
for internal use within the Tokenizer class itself, not for client |
| 2851 |
code that uses the Tokenizer class. However, they're also useful in |
| 2852 |
subclasses of Tokenizer, so it's desirable to have them defined in a |
| 2853 |
header - that way, user code implementing Tokenizer subclasses can |
| 2854 |
access the macros simply by #including tok.h. |
| 2855 |
|
| 2856 |
<li>The compiler is now stricter about interpreting tokens as |
| 2857 |
BigNumber constants. In the past, the compiler treated an "E" |
| 2858 |
following a numeric constant as an exponent signifier, even if no |
| 2859 |
digits followed. For example, "3E-a" was taken to be the BigNumber |
| 2860 |
constant "3E-0", followed by a separate token "a". The compiler now |
| 2861 |
treats an "E" as the start of a separate token if no digits follow it |
| 2862 |
(or the optional + or - sign after the "E"), so "3E-a" would now be |
| 2863 |
treated as four tokens: "3", "E", "-", and "a". |
| 2864 |
|
| 2865 |
<li>The compiler now displays a specific error if it finds a decimal |
| 2866 |
digit within an octal constant value. In the past, the compiler |
| 2867 |
simply assumed that a decimal digit terminated the octal constant |
| 2868 |
token and started a new token. This typically led to a confusing |
| 2869 |
parsing error, since the compiler saw two consecutive numeric constant |
| 2870 |
tokens where the user almost always intended one. The compiler now |
| 2871 |
flags a specific error about the ill-formed octal value, and skips any |
| 2872 |
decimal digits following the octal constant, which makes the error |
| 2873 |
much easier to pinpoint. |
| 2874 |
|
| 2875 |
<li>The compiler is now strict about disallowing the old TADS 2 |
| 2876 |
"<>" (unequal-to) operator. This variation was not documented, |
| 2877 |
but has up to now been allowed. |
| 2878 |
|
| 2879 |
<li class=last>The compiler no longer treats <tt>delete</tt> as a reserved word. |
| 2880 |
(It did so in the past as a hold-over from TADS 2, where |
| 2881 |
<tt>delete</tt> is indeed reserved.) |
| 2882 |
|
| 2883 |
</ul> |
| 2884 |
|
| 2885 |
|
| 2886 |
|
| 2887 |
<h3>Changes for 3.0.15 (3/8/2007)</h3> |
| 2888 |
|
| 2889 |
<ul> |
| 2890 |
|
| 2891 |
<li>When an input event script is being played back, the inputFile() |
| 2892 |
function now prompts the user if the result would likely overwrite an |
| 2893 |
existing file. inputFile() in this case prompts the user |
| 2894 |
interactively, momentarily halting script playback until the user |
| 2895 |
responds. This is described more fully in the Input Scripts section |
| 2896 |
of the System Manual. |
| 2897 |
|
| 2898 |
<li class=last>The compiler reported an internal error ("too much unsplicing") in |
| 2899 |
certain complex expressions involving multi-line string literals as |
| 2900 |
macro arguments in embedded << >> expressions. This has |
| 2901 |
been corrected. |
| 2902 |
|
| 2903 |
</ul> |
| 2904 |
|
| 2905 |
|
| 2906 |
|
| 2907 |
<h3>Changes for 3.0.14 (2/9/2007)</h3> |
| 2908 |
|
| 2909 |
<ul> |
| 2910 |
|
| 2911 |
<li class=last>The raiseToPower() method of the BigNumber class incorrectly |
| 2912 |
returned 1 as the result of raising 0 to a non-zero exponent. The |
| 2913 |
correct result should, of course, be 0 for any positive exponent, and |
| 2914 |
an exception for any non-positive exponent (as 0^0 is undefined, and |
| 2915 |
0^n with n<0 is effectively division by zero). The method now |
| 2916 |
yields these results. |
| 2917 |
|
| 2918 |
</ul> |
| 2919 |
|
| 2920 |
|
| 2921 |
|
| 2922 |
<h3>Changes for 3.0.13 (1/19/2007)</h3> |
| 2923 |
|
| 2924 |
<ul> |
| 2925 |
|
| 2926 |
<li>A new t3make option, -we, tells the compiler to treat warnings as |
| 2927 |
though they were errors, for the purposes of determining whether or |
| 2928 |
not to proceed with compilation after a warning occurs. When the |
| 2929 |
compiler finds an error within a source file, it stops the build |
| 2930 |
process after finishing with that compilation unit, requiring you to |
| 2931 |
fix the error before continuing. In contrast, warnings do not, by |
| 2932 |
default, interrupt the build. This is because a warning message |
| 2933 |
indicates a situation that's <i>technically</i> correct, but which |
| 2934 |
contains a common pitfall. Compiler warnings tend to be right often |
| 2935 |
enough to warrant close inspection, so many programmers adhere to the |
| 2936 |
discipline of insisting on "clean" builds every time - that is, with |
| 2937 |
no warning messages. The -we option is a convenient way of enforcing |
| 2938 |
that discipline. When you specify the -we option, the compiler will |
| 2939 |
stop the build after finishing with any module that generates any |
| 2940 |
warning messages, just as it does for error messages. If you want |
| 2941 |
to explicitly set the default mode, where warnings do not interrupt |
| 2942 |
the build, use the -we- option. |
| 2943 |
|
| 2944 |
<li>A new interpreter (t3run) option, -I, runs a command script in |
| 2945 |
"echo" mode. This works almost the same as the existing -i option, |
| 2946 |
but -I causes all output to be displayed to the console as the script |
| 2947 |
is read; in contrast, -i reads the script in "quiet" mode, meaning |
| 2948 |
that no output is displayed while the script is running. |
| 2949 |
|
| 2950 |
<li>The command script recorder and player can now handle virtually |
| 2951 |
any input event type, not just command lines. The script mechanism |
| 2952 |
can now handle keyboard input, hyperlinks, ad hoc dialogs, and file |
| 2953 |
dialogs; the functions inputKey(), inputEvent(), inputFile(), and |
| 2954 |
inputDialog() can now take their input from a script. (inputLine() |
| 2955 |
and inputLineTimeout() have always been able to read from scripts.) |
| 2956 |
To handle the greater range of event types, a new script file format |
| 2957 |
has been added; files written in new format are called Event Scripts. |
| 2958 |
Event scripts are identified by a special signature: the first line of |
| 2959 |
the file must read <tt><eventscript></tt>, with nothing else on |
| 2960 |
the line (not even spaces). If a script doesn't start with this |
| 2961 |
signature, the script reader will interpret it as the original script |
| 2962 |
format, which is now called the Command-line Script. This allows old |
| 2963 |
scripts to work without changes; of course, Command-line Scripts can |
| 2964 |
only contain line input events, as they always have. When you create |
| 2965 |
a script with RECORD or the with the Interpreter's -o option, the |
| 2966 |
script is now recorded in the new Event Script format, and the |
| 2967 |
recorder will automatically include all event types in the script. |
| 2968 |
(There's no option with RECORD or -o to record an old-style |
| 2969 |
Command-line Script instead - there wouldn't seem to be much call for |
| 2970 |
this, as the functionality in Event Scripts is a superset of that of |
| 2971 |
Command-line Scripts.) The new scripting functionality is described |
| 2972 |
in the "Input Scripts" chapter of the System Manual. |
| 2973 |
|
| 2974 |
<li>The setScriptFile() intrinsic function now accepts a new type |
| 2975 |
code, LogTypeEvent. This type signifies that a new-style Event Script |
| 2976 |
should be created. The code LogTypeCommand, which was present in |
| 2977 |
previous versions, continues to signify that an old-style Command-line |
| 2978 |
Script should be created. |
| 2979 |
|
| 2980 |
<li>Input scripts now nest during playback. In the past, reading from |
| 2981 |
a new input script terminated reading from any input script already in |
| 2982 |
effect. Now, the console suspends the original script, and resumes |
| 2983 |
reading from it upon reaching the end of the new script. Scripts can |
| 2984 |
be nested to any depth. This allows an input script to "include" |
| 2985 |
another by using, for example, the REPLAY command within the script. |
| 2986 |
|
| 2987 |
<li>In the past, the getFuncParams() intrinsic function didn't accept |
| 2988 |
an anonymous function as its argument. Anonymous functions are now |
| 2989 |
accepted. |
| 2990 |
|
| 2991 |
<li>The inputLine() intrinsic function (in the 'tads-io' function set) |
| 2992 |
didn't correctly map non-ASCII characters (such as accented letters) |
| 2993 |
from the user's input to Unicode. This has been corrected. |
| 2994 |
|
| 2995 |
<li>A compiler bug caused a crash if a "modify" or "replace" statement |
| 2996 |
in one source module referred to a symbol that was actually defined in |
| 2997 |
a source module that was included in the build after the first source |
| 2998 |
file. This is an error condition anyway - a symbol has to be defined |
| 2999 |
in the build before it can be modified or replaced, so the original |
| 3000 |
definition has to occur in a source module listed earlier than the |
| 3001 |
modifying module. However, the compiler now handles such an error |
| 3002 |
properly, by displaying the appropriate error message and halting the |
| 3003 |
build. |
| 3004 |
|
| 3005 |
<li>A bug in File.writeBytes() caused unpredictable results, sometimes |
| 3006 |
including an interpreter crash, if a zero or negative value was passed |
| 3007 |
for the starting index. The starting index is now checked for range. |
| 3008 |
|
| 3009 |
<li class=last>Some internal changes to the portable VM and compiler code have |
| 3010 |
been made to improve portability to 64-bit architectures. |
| 3011 |
|
| 3012 |
</ul> |
| 3013 |
|
| 3014 |
|
| 3015 |
|
| 3016 |
<h3>Changes for 3.0.12 (9/15/2006)</h3> |
| 3017 |
|
| 3018 |
<p><b>This is the TADS 3.0 General Release version.</b> |
| 3019 |
|
| 3020 |
<ul> |
| 3021 |
|
| 3022 |
<li class=last>A couple of compiler error messages were internally mis-numbered, |
| 3023 |
which could have caused the compiler to report the wrong error message |
| 3024 |
for the affected error codes. These have been corrected. |
| 3025 |
|
| 3026 |
</ul> |
| 3027 |
|
| 3028 |
|
| 3029 |
|
| 3030 |
<h3>Changes for 3.0.11 (9/8/2006)</h3> |
| 3031 |
|
| 3032 |
<ul> |
| 3033 |
|
| 3034 |
<li>The % operator now accepts only integer operands. (In the past, |
| 3035 |
it failed to throw an error if a BigNumber operand was used, and |
| 3036 |
instead produced a meaningless result.) |
| 3037 |
|
| 3038 |
<li>A comparison of the form "a==b", where a is an integer value and b |
| 3039 |
is a BigNumber value, now coerces the integer to a BigNumber before |
| 3040 |
comparing it. In the past, this type of comparison coerced the |
| 3041 |
integer to a BigNumber only when the BigNumber was the left-hand |
| 3042 |
operand. This correction ensures that "a==b" and "b==a" yield the |
| 3043 |
same results when comparing integers and BigNumber values. The same |
| 3044 |
change applies to the != operator. |
| 3045 |
|
| 3046 |
<li>In the past, the compiler reserved the names <tt>void</tt>, |
| 3047 |
<tt>int</tt>, <tt>string</tt>, <tt>list</tt>, <tt>boolean</tt>, and |
| 3048 |
<tt>any</tt>. These names are no longer reserved and thus can now be |
| 3049 |
used freely as symbol names (for local variables, object names, etc). |
| 3050 |
(These names were originally reserved in anticipation of the eventual |
| 3051 |
introduction of optional static type declarations. Reserving the |
| 3052 |
keywords ensured that no one would write code that would be |
| 3053 |
incompatible if the feature had ever been added. The static typing |
| 3054 |
feature will definitely not appear in the official 3.0 release, and at |
| 3055 |
this point it seems very unlikely to be in any future version, so |
| 3056 |
there's no longer any good reason to reserve these names.) |
| 3057 |
|
| 3058 |
<li class=last>A compiler bug caused invalid code to be generated in the following |
| 3059 |
situation: |
| 3060 |
|
| 3061 |
<p><pre> |
| 3062 |
x: object |
| 3063 |
m(p) { } |
| 3064 |
n = (p) // bad code generated here |
| 3065 |
p = nil |
| 3066 |
; |
| 3067 |
</pre> |
| 3068 |
|
| 3069 |
<p>The bad code resulted from the compiler mistakenly using the local |
| 3070 |
symbol table from the method m(p) while generating the code for n; so |
| 3071 |
the compiler incorrectly treated p as a parameter variable in n, even |
| 3072 |
though n has no parameters. This has been corrected. |
| 3073 |
|
| 3074 |
<p>The local-to-Unicode character set mapper now converts any |
| 3075 |
unmappable character found in a source string to Unicode U+FFFD, the |
| 3076 |
standard Unicode "replacement character." In the past, the mapper |
| 3077 |
converted unmappable characters to question marks, "?". Converting to |
| 3078 |
question marks was undesirable because of the ambiguity it created. |
| 3079 |
When compiling source code, for example, it led the compiler to think |
| 3080 |
that the source file literally contained a question mark where the |
| 3081 |
unmappable character was found; the diagnostics the compiler reported |
| 3082 |
in these cases were thus confusing and misleading. Unicode defines |
| 3083 |
the character U+FFFD specifically for the purpose of replacing source |
| 3084 |
characters that cannot be mapped to Unicode; this gives the compiler |
| 3085 |
and other consumers of mapped characters an unambiguous indication |
| 3086 |
that the original input character was unmappable. The compiler uses |
| 3087 |
this new information to report a specific diagnostic message when it |
| 3088 |
finds a U+FFFD in the input stream. |
| 3089 |
|
| 3090 |
</ul> |
| 3091 |
|
| 3092 |
|
| 3093 |
<h3>Changes for 3.0.10 (8/17/2006)</h3> |
| 3094 |
|
| 3095 |
<ul> |
| 3096 |
|
| 3097 |
<li>Libraries (".tl" files) can now easily include their own |
| 3098 |
multimedia resources in a build. In the past, there was no direct |
| 3099 |
support for multimedia resources in libraries; an author using a |
| 3100 |
library that included multimedia resources would have had to copy the |
| 3101 |
library resources into the game's directory tree and then explicitly |
| 3102 |
add those resources to the build. This is no longer necessary. Two |
| 3103 |
new features support library resources: |
| 3104 |
|
| 3105 |
<ul> |
| 3106 |
|
| 3107 |
<li>First, Workbench for Windows now automatically adds each |
| 3108 |
top-level library's directory path to the search list for individual |
| 3109 |
resource files (.jpg, .png, .ogg, etc). Note that a "top-level" |
| 3110 |
library is a library included directly in the Project window; a |
| 3111 |
library included from within another library isn't top-level, so |
| 3112 |
it's directory won't be included in the search list. When running |
| 3113 |
the game under the debugger, this allows individual resources to be |
| 3114 |
found under any library's directory tree. |
| 3115 |
|
| 3116 |
<li>Second, the compiler accepts a new "resource:" keyword in |
| 3117 |
library (.tl) files. After this keyword, list one individual |
| 3118 |
resource file, or one directory containing resource files. You can |
| 3119 |
use this keyword as many times as you like to include multiple files |
| 3120 |
or directories. As usual for library files, the file or directory |
| 3121 |
mentioned after the "resource:" keyword is given with a URL-style |
| 3122 |
relative path, relative to the library containing the library file. |
| 3123 |
|
| 3124 |
</ul> |
| 3125 |
|
| 3126 |
These new features allow a library to include multimedia resources |
| 3127 |
with complete transparency to game authors using the library - game |
| 3128 |
authors won't have to do anything extra to use the library multimedia |
| 3129 |
resources. Library authors only have to perform a few easy extra |
| 3130 |
steps. First, create a subdirectory of your library directory to |
| 3131 |
contain the resources. For example, if your library is called |
| 3132 |
mylib.tl, create a "mylibres" subdirectory under the directory |
| 3133 |
containing mylib.tl. (The name isn't important, but it's desirable to |
| 3134 |
pick a unique enough name that there won't be any conflict with other |
| 3135 |
libraries that game authors might also be including. Your resources |
| 3136 |
will be named relative to the subdirectory name, so don't pick a |
| 3137 |
generic name like "resources" - it's best to use a name that |
| 3138 |
incorporates your library name.) Second, put all of your library's |
| 3139 |
resources (.jpg files, .png files, etc.) in your new subdirectory. |
| 3140 |
Third, add the line "resource: mylibres" to your .tl file; this will |
| 3141 |
tell the compiler to bundle all of the files in the "mylibres" |
| 3142 |
subdirectory into the compiled .t3 file when a game includes your |
| 3143 |
library. Finally, in the HTML that your library generates to |
| 3144 |
reference your resources, refer to them using your subdirectory path - |
| 3145 |
for example, you'd write <IMG SRC="mylibres/compass.png"> to |
| 3146 |
refer to an image resource file. |
| 3147 |
|
| 3148 |
<li>The <a href="sysman/t3vm.htm">t3GetStackTrace()</a> |
| 3149 |
function (in the 't3vm' function set) has a new optional argument that |
| 3150 |
lets you get information on a single stack level. This provides more |
| 3151 |
efficient access to stack trace information in cases where you only |
| 3152 |
want information on a specific level, such as the immediate caller. |
| 3153 |
|
| 3154 |
<li>When a game is compiled into a stand-alone executable (on systems |
| 3155 |
where this is implemented, such as Windows), it's now possible to pass |
| 3156 |
command-line arguments to the embedded .t3 program. To do this, use a |
| 3157 |
dash ("-") to separate the interpreter arguments from the program |
| 3158 |
arguments. The stand-alone version of the interpreter is also now |
| 3159 |
strict about not accepting an image file argument; this means that you |
| 3160 |
can't use a bundled stand-alone game to run a different .t3 image file. |
| 3161 |
|
| 3162 |
<li>You can now write directly to the main game window's log file, if |
| 3163 |
one is open. (This is the log file that's opened via the setLogFile() |
| 3164 |
function - the one that the library creates when the player types the |
| 3165 |
SCRIPT command.) There are two ways to write to the log file. The |
| 3166 |
simple way is to use the new <LOG> tag - this tag is simply the |
| 3167 |
complement of the <NOLOG> tag: any text enclosed between |
| 3168 |
<LOG> and </LOG> will be included only in the log file, |
| 3169 |
and hidden in the game window. This approach is usually the right |
| 3170 |
one, because you can mix your log-only text directly with other output |
| 3171 |
text, ensuring that it's processed through the usual stack of output |
| 3172 |
filters and the like. However, on occasion it's useful to be able to |
| 3173 |
bypass the usual output stream mechanism, which brings us to the |
| 3174 |
second way: you can use logConsoleSay(), passing in the special handle |
| 3175 |
value MainWindowLogHandle as the handle. Using this approach bypasses |
| 3176 |
mainOutputStream and all of its filters, and goes directly to the log |
| 3177 |
file. |
| 3178 |
|
| 3179 |
<li>The compiler now warns on nested block comment ("/* ... */" |
| 3180 |
comments). If the compiler finds a "/*" sequence within a block |
| 3181 |
comment, it generates a warning. (Nested block comments aren't |
| 3182 |
allowed, so a "/*" within a block comment usually indicates that a |
| 3183 |
previous comment wasn't terminated properly. The warning makes it |
| 3184 |
easier to notice such cases.) |
| 3185 |
|
| 3186 |
<li>The compiler now automatically word-wraps error messages to 80 |
| 3187 |
columns when the "verbose" error message option is selected. This |
| 3188 |
makes the long error messages much easier to read, especially in |
| 3189 |
Workbench, which has an essentially infinitely wide message window - |
| 3190 |
the word-wrapping saves you the trouble of manually scrolling |
| 3191 |
horizontally to see the full message text. |
| 3192 |
|
| 3193 |
<li>A bug in the compiler sometimes caused a crash if a 'foreach' |
| 3194 |
statement was used in a source file which never #included the system |
| 3195 |
headers. The compiler correctly flagged the error, but didn't always |
| 3196 |
recover properly. The compiler now handles this situation gracefully. |
| 3197 |
|
| 3198 |
<li>A bug in the compiler caused the compiler to ignore the last line |
| 3199 |
of a library (.tl) file when the last line didn't end in a newline |
| 3200 |
character of some sort. The same bug affected Workbench on Windows. |
| 3201 |
This has been corrected. |
| 3202 |
|
| 3203 |
<li>A bug in the compiler caused incorrect results when a 'grammar' |
| 3204 |
statement's token list started with an empty alternative. For |
| 3205 |
example, the token list "( | 'x')" was compiled incorrectly. This |
| 3206 |
problem only occurred when the empty alternative was the <i>first</i> |
| 3207 |
element of the entire token list. This has been corrected. |
| 3208 |
|
| 3209 |
<li>In the past, the TadsObject type didn't retain 'undo' information |
| 3210 |
when the superclass list was changed with setSuperclassList(). This |
| 3211 |
meant that if an object's superclass was changed, an 'undo' operation |
| 3212 |
didn't properly restore the original superclass list. This has been |
| 3213 |
corrected; this undo information is now properly retained and applied. |
| 3214 |
|
| 3215 |
<li>A bug introduced in 3.0.9 caused the interpreter to misinterpret |
| 3216 |
certain Unicode characters outside of the plain ASCII range when |
| 3217 |
entered on a command line. This has been fixed. |
| 3218 |
|
| 3219 |
<li>A bug in TadsObject.setSuperclassList() caused sporadic problems. |
| 3220 |
The bug was most likely to manifest itself as a stack overflow error |
| 3221 |
when a call to self.setSuperclassList() was the first (or nearly the |
| 3222 |
first) executable code within a method. The bug is now fixed. |
| 3223 |
|
| 3224 |
<li>The regular expression parser didn't accept the special character |
| 3225 |
pattern <tab>, which is documented as matching the character |
| 3226 |
'\t' (or, equivalently, '\u0009'). This has been corrected. |
| 3227 |
|
| 3228 |
<li>The regular expression parser didn't formerly classify as |
| 3229 |
whitespace several control characters that are conventionally |
| 3230 |
considered whitespace. This was due to a strict interpretation of the |
| 3231 |
character properties defined in the Unicode character database, which |
| 3232 |
defines all of the ASCII control characters as class "Other" rather |
| 3233 |
than "Separator." The Unicode database has some additional property |
| 3234 |
information, though, that does mark the appropriate control characters |
| 3235 |
as whitespace, and the character classifier now takes this extra |
| 3236 |
information into account. This means that characters \u0009 (tab), |
| 3237 |
\u000A (line feed), \u000B (line tab), \u000C (form feed), \u000D |
| 3238 |
(carriage return), \u001c (IS4), \u001d (IS3), \u001e (IS2), and |
| 3239 |
\u001f (IS1) are now considered whitespace, and thus match the |
| 3240 |
<space> character class pattern in regular expressions. |
| 3241 |
|
| 3242 |
<li class=last>In the past, the compiler always assumed it was running under a |
| 3243 |
DOS box, so it used the DOS box code page for any messages it |
| 3244 |
displayed. On most systems, depending on localization, the DOS box |
| 3245 |
uses a different code page from the Windows code page used by native |
| 3246 |
Windows applications; this is because the DOS box is designed for |
| 3247 |
compatibility with old MS-DOS applications, which sometimes rely upon |
| 3248 |
the DOS line-drawing characters and so forth. This occasionally |
| 3249 |
caused odd character mapping problems in error messages when compiling |
| 3250 |
from Workbench, because Workbench uses the standard Windows code page |
| 3251 |
instead of the DOS code page. This has been corrected, as follows: |
| 3252 |
the compiler now checks to see if it's associated with a DOS box |
| 3253 |
window, and uses the DOS box code page for its error messages if so, |
| 3254 |
or the regular Windows code page if not. |
| 3255 |
|
| 3256 |
</ul> |
| 3257 |
|
| 3258 |
|
| 3259 |
|
| 3260 |
<h3>Changes for 3.0.9 (8/29/2005)</h3> |
| 3261 |
|
| 3262 |
<ul> |
| 3263 |
|
| 3264 |
<li>The banner API has a new pair of style flags: BannerStyleHStrut |
| 3265 |
("horizontal strut") and BannerStyleVStrut ("vertical strut"). These |
| 3266 |
style flags let you specify that bannerSetSize() should take a child |
| 3267 |
banner's width (horizontal strut) and/or height (vertical strut) into |
| 3268 |
account when figuring the parent banner's content size. By default, |
| 3269 |
only the contents of the parent banner are considered, but these new |
| 3270 |
styles let you include a child's contents in the parent banner's size |
| 3271 |
calculation. |
| 3272 |
|
| 3273 |
<li>The File intrinsic class has a new feature in its various "open" |
| 3274 |
methods. The filename passed to an "open" method can now be one of a |
| 3275 |
set of distinguished values (defined in file.h) that identify |
| 3276 |
"special" files. These are files that are meant to be used for |
| 3277 |
particular purposes. Rather than opening these files by name, you |
| 3278 |
open them by specifying their special identifiers. The interpreter |
| 3279 |
determines the actual name and location of a special file in the local |
| 3280 |
file system. This allows the interpreter to use different names of |
| 3281 |
paths on different systems, to better conform to local conventions. |
| 3282 |
Currently, there's only one special file defined: LibraryDefaultsFile, |
| 3283 |
which is a text file that's used to store the library's global |
| 3284 |
settings. |
| 3285 |
|
| 3286 |
<li>The new GrammarProd method <a href="sysman/gramprod.htm"> |
| 3287 |
getGrammarInfo()</a> provides programmatic access to information on |
| 3288 |
GrammarProd objects, which allows the game to retrieve full |
| 3289 |
information on the 'grammar' statements in the source code. Sample |
| 3290 |
code demonstrating how to use the new method to display a production's |
| 3291 |
internal information in human-readable format is included in the |
| 3292 |
samples directory, in the file gramdisp.t. |
| 3293 |
|
| 3294 |
<li>The interpreter now uses the default file-contents character set |
| 3295 |
rather than the display character set as the default for log file |
| 3296 |
output. On most systems, this change won't have any noticeable |
| 3297 |
effect, as the default display and file-contents character sets are |
| 3298 |
usually the same anyway. However, on a few systems, the display and |
| 3299 |
file-contents character sets can differ; it makes more sense on these |
| 3300 |
systems to use the file-contents character set for log files than it |
| 3301 |
does to use the display character set, since it's usually desirable to |
| 3302 |
treat log files as ordinary text files. |
| 3303 |
|
| 3304 |
<li>The new interpreter option "-csl <i>charset</i>" lets you |
| 3305 |
explicitly specify the character set for log files, overriding the |
| 3306 |
default. (The default log file character set is the file-contents |
| 3307 |
character set, as described above.) |
| 3308 |
|
| 3309 |
<li>The logConsoleCreate() function now accepts nil for the character |
| 3310 |
set argument. This chooses the default log file character set. |
| 3311 |
|
| 3312 |
<li>In tadsio.h, the constant InEvtNotimeout has been renamed to |
| 3313 |
InEvtNoTimeout (that is, the "T" in "Timeout" has been capitalized). |
| 3314 |
This change is simply cosmetic, for better consistency with the naming |
| 3315 |
convention that each word in a symbol name starts with a capital |
| 3316 |
letter. (The "o" in "Timeout" is still a minuscule, and this is |
| 3317 |
consistent with the naming convention: in computerese, "timeout" is |
| 3318 |
usually considered a single word.) To avoid breaking compatibility |
| 3319 |
with code based on previous versions, the old name is still defined as |
| 3320 |
a synonym for the new name. |
| 3321 |
|
| 3322 |
<li>The Vector class's constructor now throws an error ("value out of |
| 3323 |
range") if the maximum-length argument exceeds 65535, which is the |
| 3324 |
maximum number of elements that a Vector can have. (In the past, |
| 3325 |
attempting to create a vector with a maximum length of more than 65535 |
| 3326 |
appeared to succeed, but didn't really; it actually created a vector |
| 3327 |
with a maximum of <i>n</i> mod 65536, where <i>n</i> was the given |
| 3328 |
length.) |
| 3329 |
|
| 3330 |
<li>The compiler incorrectly considered the statement following a |
| 3331 |
'do-while' loop reachable if the loop's condition wasn't a constant |
| 3332 |
'true' expression, even if the condition itself was never reachable |
| 3333 |
and the loop contained no 'break' statements. This caused the |
| 3334 |
compiler to issue spurious warnings in certain obscure situations, |
| 3335 |
such as when such a 'do-while' was at the end of a function that had |
| 3336 |
returned values elsewhere; it also caused the compiler to fail to |
| 3337 |
generate an "unreachable statement" warning when a statement followed |
| 3338 |
such a loop. The compiler now correctly realizes that the statement |
| 3339 |
following such a loop is unreachable, and generates control flow |
| 3340 |
warnings accordingly. |
| 3341 |
|
| 3342 |
<li>A compiler bug sometimes caused problems when generating code |
| 3343 |
involving a nested anonymous function (that is, an anonymous function |
| 3344 |
defined within another anonymous function), which was defined within |
| 3345 |
an object method, <i>and</i> which made reference to local variables |
| 3346 |
defined within two or more enclosing lexical contexts. The problem |
| 3347 |
only affected code with all of these attributes, and then only showed |
| 3348 |
up some of the time. The problem manifested itself as a spurious |
| 3349 |
run-time error ("invalid index operation - this type of value cannot |
| 3350 |
be indexed") when the nested anonymous function was invoked. This |
| 3351 |
has been corrected. |
| 3352 |
|
| 3353 |
<li>A bug in the compiler caused sporadic problems that sometimes |
| 3354 |
included crashing the compiler when source code contained a constant |
| 3355 |
expression involving a list indexed by a value exactly one greater |
| 3356 |
than the number of elements in the list, as in "[1,2][3]". The |
| 3357 |
problem only occurred when everything in the expression - all of the |
| 3358 |
list elements, as well as the index value - was a constant. This has |
| 3359 |
been fixed. |
| 3360 |
|
| 3361 |
<li>Due to a bug, the compiler didn't recognize the "^=" |
| 3362 |
(XOR-and-assign) operator. This has been corrected. |
| 3363 |
|
| 3364 |
<li>A bug in the rexGroup() function caused the interpreter to crash |
| 3365 |
in a particular, rare situation: specifically, when rexGroup() was |
| 3366 |
called immediately after a call to rexSearch() or rexMatch() that |
| 3367 |
caused a run-time error. This has been corrected. |
| 3368 |
|
| 3369 |
<li>A bug in the interpreter sometimes caused unpredictable behavior, |
| 3370 |
including crashes, when t3SetSay() was used to set a property pointer |
| 3371 |
handler, and a double-quoted string was then displayed from within a |
| 3372 |
function (not an object method). This has been fixed. |
| 3373 |
|
| 3374 |
<li>A bug in the interpreter's console-output subsystem's HTML |
| 3375 |
mini-parser caused subtle problems in some rare cases with the full |
| 3376 |
multimedia interpreters (but not in text-only interpreters). For the |
| 3377 |
most part, in the full HTML interpreters, the console subsystem just |
| 3378 |
passes HTML markups directly through to the HTML renderer. It does, |
| 3379 |
however, keep track of HTML sequences for its own purposes. One of |
| 3380 |
these is to apply the "\^" and "\v" (capitalize and un-capitalize) |
| 3381 |
flags to actual text rather than to HTML markups. The bug caused the |
| 3382 |
HTML tracker to lose track of where it was in an HTML sequence when a |
| 3383 |
tag included quoted attribute values. The only known symptom of the |
| 3384 |
bug was that a "\^" or "\v" flag that appeared immediately before an |
| 3385 |
HTML tag that contained quoted attribute values was sometimes |
| 3386 |
misapplied to text within the HTML tag, effectively losing the effect |
| 3387 |
of the flag. This has now been fixed. |
| 3388 |
|
| 3389 |
<li>A bug in the Dictionary class caused problems when setting a |
| 3390 |
string comparator object that wasn't a StringComparator object. The |
| 3391 |
Dictionary allowed setting the new comparator, but would then generate |
| 3392 |
a spurious error (usually "invalid type") on calling any of the |
| 3393 |
methods that called comparator methods (addWord, findWord, etc). This |
| 3394 |
has been corrected. |
| 3395 |
|
| 3396 |
<li>The Vector.copyFrom() method had a bug that caused the wrong |
| 3397 |
number of elements to be copied in some cases. In particular, when |
| 3398 |
the destination vector had to be expanded to hold the new elements, |
| 3399 |
the method copied one fewer element than was requested. This has been |
| 3400 |
fixed. |
| 3401 |
|
| 3402 |
<li>A compiler bug caused duplicate "unreachable statement" to be |
| 3403 |
displayed when a 'switch' contained a case with an unreachable |
| 3404 |
'break' statement. The duplicate messages no longer occur. |
| 3405 |
|
| 3406 |
<li>Due to a bug, the compiler sometimes crashed if a 'switch' |
| 3407 |
statement contained an unreachable 'break' statement in one of its |
| 3408 |
cases, <i>and</i> the statement immediately after the 'switch' was |
| 3409 |
also unreachable. This has been fixed. |
| 3410 |
|
| 3411 |
<li>The compiler is now more consistent about where double-quoted |
| 3412 |
strings are allowed and not allowed. First, superficial parentheses |
| 3413 |
are now accepted around double-quoted strings wherever the strings |
| 3414 |
would otherwise be legal. Second, the comma operator can now be used |
| 3415 |
to juxtapose two or more double-quoted strings; the effect is simply |
| 3416 |
to display the strings in the order given, as though they had been |
| 3417 |
concatenated into a single string. Third, the compiler formerly |
| 3418 |
accepted double-quoted strings, incorrectly, if they were used within |
| 3419 |
the 'true' or 'false' operands of a '?:' operator that was embedded |
| 3420 |
within any larger expression. The compiler now correctly flags this |
| 3421 |
as an error. |
| 3422 |
|
| 3423 |
<li>The compiler is now stricter about flagging errors for a few |
| 3424 |
syntactically invalid constructs that were formerly accepted. It's |
| 3425 |
probably counterintuitive that more error messages are a good thing, |
| 3426 |
but, really, they are in cases like this - if a construct is invalid, |
| 3427 |
you're better off if the compiler catches it and tells you about it, |
| 3428 |
because otherwise the compiler is going to do something poorly defined |
| 3429 |
with the input. Without an error message, it won't be obvious that |
| 3430 |
anything is amiss until the program starts behaving unexpectedly at |
| 3431 |
run-time. The compiler now properly flags errors when it detects |
| 3432 |
these constructs. Specifically, the compiler now enforces the |
| 3433 |
following grammar rules: |
| 3434 |
|
| 3435 |
<ul> |
| 3436 |
|
| 3437 |
<li>Each formal parameter in a 'propertyset' declaration, including |
| 3438 |
the "*" parameter, must be separated by exactly one comma from adjacent |
| 3439 |
parameters. |
| 3440 |
|
| 3441 |
<li>'transient' cannot be used in the definition of a new template - |
| 3442 |
that is, "transient <i>class</i> template ..." is illegal. |
| 3443 |
|
| 3444 |
<li>Empty templates ("<i>class</i> template;") are illegal. |
| 3445 |
|
| 3446 |
<li>Parentheses are required around the condition expression of |
| 3447 |
a do-while statement. |
| 3448 |
|
| 3449 |
</ul> |
| 3450 |
|
| 3451 |
<li>The compiler now allows "local" declarations to be labeled |
| 3452 |
(via regular labels as well as "case" and "default" labels). In |
| 3453 |
the past, the compiler didn't allow labeled local declarations. |
| 3454 |
There wasn't any good reason for this restriction; it was just |
| 3455 |
a quirk of the way the compiler's grammar was defined. |
| 3456 |
|
| 3457 |
<li>The toString() function formerly failed on conversions to base 2 |
| 3458 |
of a value over 262143, with a run-time exception. This has been |
| 3459 |
corrected, so the function should now properly convert any 32-bit |
| 3460 |
integer value to a base 2 string representation. |
| 3461 |
|
| 3462 |
<li>The toInteger() function now accepts base 2 as the input format. |
| 3463 |
|
| 3464 |
<li>The compiler is now more tolerant of different newline formats in |
| 3465 |
library (.tl) files. In the past, the compiler generally expected .tl |
| 3466 |
files to conform to local newline conventions; this made it more |
| 3467 |
difficult to re-use libraries on different operating systems, since it |
| 3468 |
was sometimes necessary to convert newlines first. Source code files |
| 3469 |
(.t and .h files) were never affected by this, but the part of the |
| 3470 |
compiler that read .tl files wasn't as flexible. The compiler's .tl |
| 3471 |
file reader now accepts essentially any newline format: it will accept |
| 3472 |
newlines consisting of CR-LF sequences, LF-CR sequences, simple CR |
| 3473 |
newlines, and simple LF newlines. It doesn't matter what your |
| 3474 |
computer's native newline conventions are - every port of the compiler |
| 3475 |
will now accept any of these formats. |
| 3476 |
|
| 3477 |
<li class=last>Due to a bug, the compiler's macro preprocessor didn't properly |
| 3478 |
expand macros that included the #ifempty or #ifnempty operators. |
| 3479 |
In particular, any text in the macro's definition prior to the |
| 3480 |
#ifempty or #ifnempty was effectively discarded; the text wasn't |
| 3481 |
included in the expansion. This is now fixed. |
| 3482 |
|
| 3483 |
|
| 3484 |
</ul> |
| 3485 |
|
| 3486 |
|
| 3487 |
<h3>Changes for 3.0.8 (9/12/2004)</h3> |
| 3488 |
|
| 3489 |
<ul> |
| 3490 |
|
| 3491 |
<li>The compiler now enforces unique naming for all of the modules in |
| 3492 |
a project. Using the same name for two (or more) modules can cause |
| 3493 |
problems, mostly because both modules would have the same filename for |
| 3494 |
their object files and thus one would overwrite the other. In the |
| 3495 |
past, when a module name conflict caused this kind of problem, the |
| 3496 |
compiler reported the errors caused by the name collision, but it |
| 3497 |
wasn't always easy to figure out that the name collision was the root |
| 3498 |
cause. To avoid this potential source of confusion, the compiler now |
| 3499 |
checks the entire project for module name collisions, and flags an |
| 3500 |
error if any collisions are found. |
| 3501 |
|
| 3502 |
<li>The "file safety" levels have changed slightly to provide better |
| 3503 |
security against malicious game programs. First, level 2, which |
| 3504 |
formerly provided global read access but no write access, now instead |
| 3505 |
provides read/write access to the current working directory only (the |
| 3506 |
game isn't allowed any access to files outside of the working |
| 3507 |
directory). Second, the default safety level is now level 2. In the |
| 3508 |
past, level 1 (read from any file/write to current directory only) was |
| 3509 |
the default, which left open the possibility that a game could access |
| 3510 |
data outside of the working directory. A malicious game could |
| 3511 |
conceivably have exploited this by, for example, secretly copying |
| 3512 |
sensitive data to the game directory for later use by a coordinating |
| 3513 |
network worm, or by encoding the data in a hyperlink (displayed in an |
| 3514 |
HTML-enabled game) that takes the player to a spyware site when |
| 3515 |
clicked. The new default setting should effectively eliminate these |
| 3516 |
risks by barring access to any files outside of the working directory. |
| 3517 |
|
| 3518 |
<li>Several of the system headers formerly lacked #include directives |
| 3519 |
for other headers they depended upon. This didn't cause problems most |
| 3520 |
of the time, since the necessary headers were usually included from |
| 3521 |
somewhere else anyway, but it meant that you had to include system |
| 3522 |
headers in the right order to avoid compiler errors. Each of the |
| 3523 |
system headers now explicitly includes any other headers it depends |
| 3524 |
upon, which ensures that each system header can be included in |
| 3525 |
isolation, and in any order with respect to other headers. |
| 3526 |
|
| 3527 |
<li>The saveGame(), restoreGame(), and restartGame() intrinsic |
| 3528 |
functions can now be called from recursive VM invocations (that is, |
| 3529 |
from contexts where a call to an intrinsic function or method has |
| 3530 |
invoked a byte-code callback function, such as an anonymous function |
| 3531 |
passed to an iteration method on a collection object). This restriction |
| 3532 |
was needed in the distant past, but it's been vestigial since version |
| 3533 |
3.0.5a (when the save/restore mechanism was overhauled to exlude the |
| 3534 |
call stack and execution context from the saved state information). |
| 3535 |
Since the restriction is no longer necessary, it's now been removed. |
| 3536 |
|
| 3537 |
<li>In the intrinsic function getLocalCharSet(), the new constant |
| 3538 |
CharsetFileCont can be used to retrieve the name of the character set |
| 3539 |
typically used for the contents of text files on the local system. |
| 3540 |
(Note that this is only the <i>typical</i> character set for text |
| 3541 |
files on the local system; there's no guarantee that any particular |
| 3542 |
file uses this character set. The actual character set of a given |
| 3543 |
text file is determined by the user and application that created the |
| 3544 |
file.) |
| 3545 |
|
| 3546 |
<li>In tadsio.h, the constant CharsetFile (for use with the |
| 3547 |
getLocalCharSet() function) has been renamed to CharsetFileName. The |
| 3548 |
name change is to emphasize that the constnat refers to the character |
| 3549 |
set used in the local file system for <i>names</i> of files, as |
| 3550 |
opposed to the <i>contents</i> of text files. |
| 3551 |
|
| 3552 |
<li>The compiler sometimes incorrectly complained about a missing |
| 3553 |
option argument when a "-x" option (with a valid argument supplied) |
| 3554 |
was used at the very end of a command line. This has been corrected. |
| 3555 |
|
| 3556 |
<li class=last>A bug in the compiler occasionally caused floating point constants |
| 3557 |
that included exponential ("E" suffixes) to be mis-parsed. When this |
| 3558 |
happened, one or more spurious, random extra digits of precision were |
| 3559 |
added to the end of the number's mantissa. This has been corrected. |
| 3560 |
|
| 3561 |
</ul> |
| 3562 |
|
| 3563 |
|
| 3564 |
<h3>Changes for 3.0.7 (6/12/2004)</h3> |
| 3565 |
|
| 3566 |
<p><i>There are no changes to the compiler or interpreter core in |
| 3567 |
this release. The only changes in the adv3 library and the |
| 3568 |
Windows HTML TADS interpreter.</i> |
| 3569 |
|
| 3570 |
|
| 3571 |
<h3>Changes for 3.0.6q (5/9/2004)</h3> |
| 3572 |
|
| 3573 |
<p><i>There are no changes to the compiler or interpreter core in this |
| 3574 |
release. The only changes are in the adv3 library and the Windows |
| 3575 |
HTML TADS interpreter.</i> |
| 3576 |
|
| 3577 |
|
| 3578 |
|
| 3579 |
<h3>Changes for 3.0.6p (4/25/2004)</h3> |
| 3580 |
|
| 3581 |
<ul> |
| 3582 |
|
| 3583 |
<li>The regular expression parser now accepts the special character |
| 3584 |
codes <lbrace> and <rbrace> for left and right "curly" |
| 3585 |
braces, "{" and "}", respectively. Since curly braces are special |
| 3586 |
characters in regular expressions, it's convenient to have named |
| 3587 |
character codes for them. |
| 3588 |
|
| 3589 |
<li>In the past, the regular expression parser accepted a closure |
| 3590 |
modifier (a "*", for example) directly following an assertion |
| 3591 |
expression. Since assertions don't consume any input text, repeating |
| 3592 |
one with a closure doesn't change the meaning of an expression, so a |
| 3593 |
closure following an assertion is meaningless. However, doing so had |
| 3594 |
the undesirable effect of creating an infinite loop, as the regular |
| 3595 |
expression matcher tried pointlessly to find out how many times a |
| 3596 |
successful assertion could be successful (the answer is always: as |
| 3597 |
many times as you try). The regular expression parser now avoids such |
| 3598 |
infinite loops by simply ignoring any closure modifier that's applied |
| 3599 |
to an assertion. (Note, however, that you can still trick the parser |
| 3600 |
into building an infinite loop with a more complex expression. For |
| 3601 |
example, you can enclose one or more assertions in parentheses, and |
| 3602 |
then apply a closure to the parenthesized group. The regexp parser |
| 3603 |
isn't sophisticated enough to detect these more subtle infinite loops; |
| 3604 |
it can only detect the obvious kind where a closure is applied |
| 3605 |
directly to an assertion.) |
| 3606 |
|
| 3607 |
<li>A bug in the compiler caused incorrect results when an anonymous |
| 3608 |
function referred to a property of "self," when the function was |
| 3609 |
defined within a list value of a property. The property evaluation |
| 3610 |
within the anonymous function typically yielded nil in these cases, |
| 3611 |
even when that property had a non-nil value in the object containing |
| 3612 |
the property with the list value containing the anonymous function. |
| 3613 |
The same problem showed up whether the property containing the list |
| 3614 |
value was defined with the ordinary "prop = val" syntax or with a |
| 3615 |
template. This has been corrected; properties of self will now yield |
| 3616 |
correct results in these cases. To be more concrete, in the example |
| 3617 |
below, evaluating testObj.prop1[1]() should display "hello!" on the |
| 3618 |
console, and now does this correctly; but in the past, this example |
| 3619 |
displayed nothing, because the evaluation of prop2 within the |
| 3620 |
anonymous function yielded nil. |
| 3621 |
|
| 3622 |
<p><pre> testObj: object |
| 3623 |
prop1 = [ {: say(prop2) } ] |
| 3624 |
prop2 = 'hello!' |
| 3625 |
; |
| 3626 |
</pre> |
| 3627 |
|
| 3628 |
<li>A bug in the compiler caused the compiler to crash in some cases |
| 3629 |
when presented with an anonymous function within a list value of an |
| 3630 |
object property defined with a template. The problem has been |
| 3631 |
corrected. |
| 3632 |
|
| 3633 |
<li>The compiler incorrectly reported a standard-level warning when a |
| 3634 |
function or method "list parameter" was unused within the function or |
| 3635 |
method. (A list parameter is a formal parameter defined in square |
| 3636 |
brackets to indicate that it receives a list containing the actual |
| 3637 |
parameters, which can vary in number, when the method is called.) The |
| 3638 |
compiler also incorrectly reported the warning as an assigned but |
| 3639 |
unused value; it should have reported it as an unused parameter |
| 3640 |
instead. The compiler now reports the correct warning, and only |
| 3641 |
reports it at "pedantic" level; this makes the handling of list |
| 3642 |
parameters consistent with the treatment of ordinary formal |
| 3643 |
parameters. |
| 3644 |
|
| 3645 |
</ul> |
| 3646 |
|
| 3647 |
|
| 3648 |
|
| 3649 |
<h3>Changes for 3.0.6o (3/14/2004)</h3> |
| 3650 |
|
| 3651 |
<ul> |
| 3652 |
|
| 3653 |
<li class=last>The MIME type for saved position files has been changed to |
| 3654 |
"application/x-t3vm-state". The Windows installers have been updated |
| 3655 |
to reflect the new MIME type. |
| 3656 |
|
| 3657 |
</ul> |
| 3658 |
|
| 3659 |
|
| 3660 |
|
| 3661 |
<h3>Changes for 3.0.6n (3/6/2004)</h3> |
| 3662 |
|
| 3663 |
<ul> |
| 3664 |
|
| 3665 |
<li>The debugger now automatically includes "self" in the local |
| 3666 |
variable list whenever examining a frame in which "self" is valid. |
| 3667 |
|
| 3668 |
<li>On Windows, the installers now add the MIME type for the compiled |
| 3669 |
game file type (.t3) and the saved position file type (.t3v) to the |
| 3670 |
system registry. This information can be helpful to applications, |
| 3671 |
particularly those that perform file transfers. (The MIME type for |
| 3672 |
a compiled game is "application/x-t3vm-image", and the type for |
| 3673 |
saved position files is "application/x-t3vm-save".) |
| 3674 |
|
| 3675 |
<li>A compiler bug caused the compiler to crash when certain obscure |
| 3676 |
kinds of syntax errors occurred inside nested object definitions. |
| 3677 |
This has been corrected. |
| 3678 |
|
| 3679 |
<li>A bug in the compiler caused the compiler to crash when it was |
| 3680 |
attempting to parse a one-line function or method that contained an |
| 3681 |
unclosed anonymous function. The problem was most likely to be seen |
| 3682 |
when the errant one-liner was the last thing in a source file. The |
| 3683 |
compiler now generates appropriate error messages and terminates |
| 3684 |
normally. |
| 3685 |
|
| 3686 |
<li>A bug in the ByteArray class caused the VM to crash when a |
| 3687 |
ByteArray was used as a key in a LookupTable. This has been |
| 3688 |
corrected. |
| 3689 |
|
| 3690 |
<li>A bug in the BigNumber class caused the VM to crash in some cases |
| 3691 |
when a string was used as the source value to construct a new |
| 3692 |
BigNumber. This should now work reliably. |
| 3693 |
|
| 3694 |
<li>A bug in the debugger caused a crash when execution stopped |
| 3695 |
inside an anonymous function with no 'self' context. The most common |
| 3696 |
place to encounter this problem was at a run-time error in an |
| 3697 |
anonymous function defined inside a list, such as in an EventList |
| 3698 |
object. The problem has been corrected. |
| 3699 |
|
| 3700 |
<li>On Windows, the Author's Kit installer failed to create the |
| 3701 |
samples\obj subdirectory. That subdirectory is required to build |
| 3702 |
the sample game (sample.t3m) included in the kit, so you had to |
| 3703 |
manually create the directory before you could compile the game. |
| 3704 |
The installer now automatically creates the directory. |
| 3705 |
|
| 3706 |
<li class=last>The BigNumber class incorrectly returned a result of zero when |
| 3707 |
dividing zero by zero. (This only happened when the dividend was |
| 3708 |
zero; for other dividend values, a divide-by-zero exception was |
| 3709 |
correctly thrown.) This now throws a divide-by-zero exception. |
| 3710 |
|
| 3711 |
</ul> |
| 3712 |
|
| 3713 |
|
| 3714 |
<h3>Changes for 3.0.6m (11/15/2003)</h3> |
| 3715 |
|
| 3716 |
<p><i>Note: 3.0.6l was a library-only release, so there was no system |
| 3717 |
release called 3.0.6l.</i> |
| 3718 |
|
| 3719 |
<ul> |
| 3720 |
|
| 3721 |
<li>The propNotDefined mechanism is now invoked when 'inherited' |
| 3722 |
fails to find a base class implementation of the method being |
| 3723 |
inherited. This works almost exactly the same way it does when |
| 3724 |
propNotDefined is invoked during a normal method/property call, |
| 3725 |
with only one difference: when 'inherited' fails to find a base |
| 3726 |
class property, it searches for a 'propNotDefined' using the |
| 3727 |
same search pattern it used to seek the original inherited |
| 3728 |
property. For example, consider this code: |
| 3729 |
|
| 3730 |
<p><pre> |
| 3731 |
export propNotDefined; |
| 3732 |
|
| 3733 |
class A: object |
| 3734 |
propNotDefined(prop, [args]) { "This is A.propNotDefined\n"; } |
| 3735 |
; |
| 3736 |
|
| 3737 |
class B: A |
| 3738 |
propNotDefined(prop, [args]) { "This is B.propNotDefined\n"; } |
| 3739 |
p1() { inherited(); } |
| 3740 |
; |
| 3741 |
|
| 3742 |
main(args) |
| 3743 |
{ |
| 3744 |
local x = new B(); |
| 3745 |
x.p1(); |
| 3746 |
} |
| 3747 |
</pre> |
| 3748 |
|
| 3749 |
<p>When this program is run, the result displayed will be "This is |
| 3750 |
A.propNotDefined". B.p1() attempts to inherit the base class |
| 3751 |
definition of p1(); when it doesn't find an inherited definition, it |
| 3752 |
searches for propNotDefined() using the same search pattern it used |
| 3753 |
to find the inherited p1(). That is, the search starts with B's |
| 3754 |
superclass, because that's where the search for the inherited p1() |
| 3755 |
started from. |
| 3756 |
|
| 3757 |
<li>The t3SetSay() intrinsic function now returns the previous default |
| 3758 |
output function or method. (The return value corresponds to the |
| 3759 |
argument value: if the argument sets a new function pointer, the |
| 3760 |
return value is the old function pointer; if the argument is a new |
| 3761 |
property ID, the return value is the old property ID.) This allows |
| 3762 |
code to save the old value for later restoration, if desired. In |
| 3763 |
addition, the new special argument values T3SetSayNoFunc and |
| 3764 |
T3SetSayNoMethod can be specified to cancel any existing default |
| 3765 |
output function or method, respectively, and the function returns |
| 3766 |
these values when needed to indicate the absence of a previous |
| 3767 |
setting. |
| 3768 |
|
| 3769 |
<li>The t3SetSay() function now accepts an anonymous function as |
| 3770 |
the default output function. (In the past, only a regular named |
| 3771 |
function was acceptable.) |
| 3772 |
|
| 3773 |
<li>When propNotDefined() is invoked, the interpreter now sets |
| 3774 |
'targetprop' to &propNotDefined. In the past, the interpreter |
| 3775 |
incorrectly set 'targetprop' to the property originally invoked. |
| 3776 |
This was incorrect; one important consequence was that it didn't |
| 3777 |
allow propNotDefined() itself to use 'inherited' to invoke the base |
| 3778 |
class's implementation. |
| 3779 |
|
| 3780 |
<li>The compiler now automatically adds a property called |
| 3781 |
'sourceTextOrder' to each non-class object defined in a source file. |
| 3782 |
The value of the property is an integer giving the object's order in |
| 3783 |
the source file in which it's defined. This value is defined to |
| 3784 |
increase monotonically throughout a source file, so you can use it to |
| 3785 |
sort a collection of objects into the same order in which they appear |
| 3786 |
in the source text. This property is useful when you want to create |
| 3787 |
an initialized structure of objects (such as a list or a tree), and |
| 3788 |
you want objects within the structure to have the same order at |
| 3789 |
run-time that they have in the source text. In the past, there was |
| 3790 |
no straightforward way to guarantee source text ordering, because |
| 3791 |
the compiler and linker assign object ID's in arbitrary order. |
| 3792 |
This new property is guaranteed to reflect the original source |
| 3793 |
text order, so you can use it to initialize the run-time order. |
| 3794 |
Note that a 'modify' statement doesn't assign a new sourceTextOrder |
| 3795 |
to the underlying object; the original sourceTextOrder is retained |
| 3796 |
for a modified object. Note also that sourceTextOrder only tells you |
| 3797 |
the relative order of objects within a single source file; the compiler |
| 3798 |
resets the counter at the start of each new source file, so it's not |
| 3799 |
meaningful to compare sourceTextOrder values for objects in different |
| 3800 |
source modules. |
| 3801 |
|
| 3802 |
<li>The toInteger() function now accepts an integer value as its |
| 3803 |
first argument. If the first argument is an integer, the function |
| 3804 |
simply returns the same value; the optional second argument (the |
| 3805 |
radix value) is ignored if present. |
| 3806 |
|
| 3807 |
<li>The BigNumber constructor now accepts another BigNumber as the |
| 3808 |
source value. This creates a new BigNumber with the given source |
| 3809 |
value at an optional new precision, rounding the original value if |
| 3810 |
the new precision is less than that of the source value. |
| 3811 |
|
| 3812 |
<li>The BigNumber method formatString() incorrectly returned an empty |
| 3813 |
string when formatting a fractional number if the maximum digit count |
| 3814 |
for formatting was insufficient to reach the first non-zero digit of |
| 3815 |
the fractional value. For example, 0.0001.formatString(3) returned |
| 3816 |
an empty string. The method now returns '0' for these cases. |
| 3817 |
|
| 3818 |
<li>In most of the character-mode interpreters, if a line of |
| 3819 |
highlighted or colored text appeared just before a "MORE" prompt, |
| 3820 |
subsequent text was incorrectly highlighted or colored like the |
| 3821 |
line before the "MORE" prompt. This has been fixed. |
| 3822 |
|
| 3823 |
<li>The character-mode interpreters very occasionally crashed on exit, |
| 3824 |
due to a bug in the termination code. This has been corrected. |
| 3825 |
|
| 3826 |
<li>In most of the character-mode interpreters that support the |
| 3827 |
"-plain" mode, the interpreter is now more thorough about flushing |
| 3828 |
the standard output before stopping to read input. This makes the |
| 3829 |
plain mode interoperate better with other programs using "pipes" |
| 3830 |
and similar OS-specific input/output redirection. This change pertains |
| 3831 |
to the MS-DOS and Unix versions, and to any other platforms based on |
| 3832 |
the common character-mode layer (known technically as "osgen3"). |
| 3833 |
|
| 3834 |
<li>The rand() function now accepts a Vector as its argument. |
| 3835 |
A vector argument behaves the same as a list argument: the function |
| 3836 |
randomly chooses one of the elements of the vector and returns it. |
| 3837 |
|
| 3838 |
<li>A bug in the TadsObject.createInstanceOf() method caused an |
| 3839 |
incorrect value to be left on the VM stack during creation of the |
| 3840 |
new object. This showed up as an incorrect argument value if a |
| 3841 |
method was invoked on the new object as part of the createInstanceOf() |
| 3842 |
expression. This has been corrected. |
| 3843 |
|
| 3844 |
<li>The text-only interpreters incorrectly paid attention to a |
| 3845 |
<BODY> tag within an <ABOUTBOX> tag, setting any color |
| 3846 |
scheme specified in the <BODY> tag. This improperly set the |
| 3847 |
main text window to the color scheme intended only for use inside |
| 3848 |
the about-box. This no longer occurs. |
| 3849 |
|
| 3850 |
<li>The forEachAssoc() method of the List and Vector intrinsic classes |
| 3851 |
incorrectly passed a zero-based index for the 'key' parameter to the |
| 3852 |
callback (that is, the first element was identified by index 0, the |
| 3853 |
second by index 1, etc., C-style). This should have been a one-based |
| 3854 |
index for consistency with all of the other indexing operations for |
| 3855 |
List and Vector. This is now fixed. |
| 3856 |
|
| 3857 |
<li>Vector.setLength() will now throw an error if the given length |
| 3858 |
is less than zero. (In the past, it accepted an invalid length, |
| 3859 |
leading to unpredictable results.) |
| 3860 |
|
| 3861 |
<li>Under certain conditions, the debugger didn't stop in response to |
| 3862 |
a "Break" key (Ctrl-C, Ctrl+Break, or whatever key is appropriate to |
| 3863 |
local convention). In particular, if a single line of code contained |
| 3864 |
an infinite loop, and the user ran the program, broke into the loop |
| 3865 |
once, and then resumed execution, the debugger ignored subsequent |
| 3866 |
break keys. This has been corrected. |
| 3867 |
|
| 3868 |
<li>The compiler incorrectly reported errors in the branches of an |
| 3869 |
'if' statement at the line of the 'if' itself if the branches were |
| 3870 |
bare statements (not enclosed in braces). The same applied to |
| 3871 |
'while', 'for', and 'do while' statements when their bodies were bare |
| 3872 |
statements. The compiler now reports these errors at the |
| 3873 |
sub-statement locations. |
| 3874 |
|
| 3875 |
<li>The compiler generated an incorrect debugger line number record |
| 3876 |
under certain obscure circumstances: if the source file contained an |
| 3877 |
object or class based on multiple superclasses, and the class didn't |
| 3878 |
define an explicit constructor, then the compiler generated an |
| 3879 |
incorrect line record for the last executable line of code in the |
| 3880 |
file. This is now fixed. |
| 3881 |
|
| 3882 |
<li>The compiler now shows Unicode escape sequences when displaying an |
| 3883 |
error message containing characters from the source file that can't be |
| 3884 |
represented in the compiler console character set. For example, if |
| 3885 |
you're running the compiler in a terminal window on Unix, and your |
| 3886 |
terminal window is set up to display Latin-1 (ISO-8859-1) characters, |
| 3887 |
and you're compiling a source file prepared in Latin-2, your terminal |
| 3888 |
window would be unable to correctly display some of the characters in |
| 3889 |
the source file, because Latin-2 has characters that aren't part of |
| 3890 |
Latin-1. In the past, if any of these "unmappable" characters were |
| 3891 |
shown as part of a compiler error message, the compiler showed them as |
| 3892 |
question marks. Now, the compiler shows them as "backslash" escape |
| 3893 |
sequences. For exampe, Latin-2 character 171, "T with caron," would |
| 3894 |
be displayed as "\u0164", since its Unicode code is 0x164. This |
| 3895 |
change doesn't affect the display of compatible characters - all |
| 3896 |
mappable characters will still be displayed in the local character |
| 3897 |
set. This only affects characters that were formerly displayed as |
| 3898 |
question marks. |
| 3899 |
|
| 3900 |
<li>The default "file safety level" is now 1, which allows reading |
| 3901 |
from any file and writing only to the current working directory. |
| 3902 |
This default setting provides games with reasonable flexibility, but |
| 3903 |
helps prevent the possibility that a malicious author can modify |
| 3904 |
important files on your hard disk by limiting writing operations to |
| 3905 |
the game's working directory only. You can override this using |
| 3906 |
the "-s" option if you want to set a more permissive or more |
| 3907 |
restrictive safety level. |
| 3908 |
|
| 3909 |
<li>In Workbench for Windows, the "Build for Release" command |
| 3910 |
didn't properly invoke the "t3res" command for building external |
| 3911 |
resource files (.3r0, etc). This now works properly. |
| 3912 |
|
| 3913 |
<li>A problem in the debugger caused sporadic bad behavior when a |
| 3914 |
finalizer method threw an exception (out of the finalize() method; |
| 3915 |
throwing around exceptions within a finalizer was fine, as long as the |
| 3916 |
exception was caught entirely within the finalizer). This manifested |
| 3917 |
itself in numerous different ways, ranging from no visible effects |
| 3918 |
to full Workbench crashes. The problem only occurred in the debugger; |
| 3919 |
the regular non-debug VM didn't have the problem. This has now |
| 3920 |
been corrected. |
| 3921 |
|
| 3922 |
<li>The VM now recovers more gracefully from stack overflow |
| 3923 |
exceptions. In the past, stack overflows tended to be unrecoverable |
| 3924 |
because the VM would usually encounter a second stack overflow in the |
| 3925 |
course of trying to create an exception object to represent the |
| 3926 |
original stack overflow, forcing the VM to terminate the game |
| 3927 |
summarily to avoid an infinite loop of exceptions thrown while |
| 3928 |
handling exceptions thrown while handling exceptions, ad infinitum. |
| 3929 |
The VM now keeps a small emergency reserve of stack space for |
| 3930 |
handling stack overflow errors, which should in most cases allow an |
| 3931 |
exception object to be created normally, which in turn allows the |
| 3932 |
game to catch and handle the exception just like any other run-time |
| 3933 |
error. |
| 3934 |
|
| 3935 |
<li>The debugger now gives you more flexibility in recovering from |
| 3936 |
stack overflow errors. In the past, if your program caused a stack |
| 3937 |
overflow (due to infinite recursion, for example), the debugger |
| 3938 |
itself was unable to evaluate expressions without itself encountering |
| 3939 |
stack overflows, since the debugger shares the stack with the VM. |
| 3940 |
The debugger now holds some of the stack in reserve specifically for |
| 3941 |
handling stack overflows; when a stack overflow occurs, the debugger |
| 3942 |
uses the reserve for its own purposes, allowing you to evaluate |
| 3943 |
expressions and carry on normally within the debugger. This makes it |
| 3944 |
easier to figure out why the stack overflow occurred. Note that you |
| 3945 |
can often use the debugger to recover from a stack overflow by |
| 3946 |
manually moving the execution pointer to a 'return' statement (or the |
| 3947 |
end of the method), breaking off the infinite recursion that caused |
| 3948 |
the overflow. |
| 3949 |
|
| 3950 |
<li class=last>The debugger now shows anonymous functions more descriptively in |
| 3951 |
stack traces. In the past, these showed a string like |
| 3952 |
"[1234].prop#0(5,6)"; now, the debugger shows "{anonfn:1234}(5,6)" |
| 3953 |
instead. The "1234" is an internal object identifier for the |
| 3954 |
anonymous function; this conveys no specific human-readable meaning |
| 3955 |
other than to distinguish one function from another. The |
| 3956 |
corresponding change has also been made in reflect.t, in |
| 3957 |
reflectionServices.formatStackFrame(). |
| 3958 |
|
| 3959 |
</ul> |
| 3960 |
|
| 3961 |
|
| 3962 |
|
| 3963 |
<h3>Changes for 3.0.6k (8/17/2003)</h3> |
| 3964 |
|
| 3965 |
<ul> |
| 3966 |
|
| 3967 |
<li>The debugger now supports stop-on-change conditional breakpoints. |
| 3968 |
When you create a breakpoint with a condition expression, the debugger |
| 3969 |
now offers a choice between stopping when the expression evaluates to |
| 3970 |
true or stopping when the expression's value changes. In the past, |
| 3971 |
there was no choice, and only stop-when-true conditions were |
| 3972 |
supported. Stop-on-change is now the default when creating a new |
| 3973 |
global breakpoint. |
| 3974 |
|
| 3975 |
<li>The system.tl library now includes the default system startup |
| 3976 |
module, _main.t. In addition, it sets the new library flag, "nodef", |
| 3977 |
to indicate that the library replaces the default system modules that |
| 3978 |
the compiler would otherwise include in the build automatically. This |
| 3979 |
change primarily benefits users of Workbench for Windows, in that it |
| 3980 |
causes Workbench to include _main.t explicitly in the list of source |
| 3981 |
files. This makes it more convenient to view the file within |
| 3982 |
Workbench, set breakpoints inside it, and trace into it. (This change |
| 3983 |
will have no effect on most existing games. The only games affected |
| 3984 |
would be those that include system.tl <i>and</i> include a |
| 3985 |
non-standard startup module, using the "-nodef" compiler flag to |
| 3986 |
suppress the default inclusion of _main.t. This is an unlikely |
| 3987 |
scenario, but if it applies, here's what to do: drop the "-nodef" |
| 3988 |
compiler flag from your project file, and instead add "-x _main" |
| 3989 |
immediately after the "-lib system" inclusion.) |
| 3990 |
|
| 3991 |
<li>The new directive "nodef" can appear within a library (.tl) file. |
| 3992 |
This instructs the compiler that the library includes the same modules |
| 3993 |
that the compiler would include by default, or replacements for the |
| 3994 |
standard modules. If a library includes the "nodef" directive, then |
| 3995 |
including that library in the build has the same effect as including |
| 3996 |
the "-nodef" option on the compiler command line or in the project |
| 3997 |
(.t3m) file. |
| 3998 |
|
| 3999 |
<li>In the past, the text-only interpreters didn't properly handle banner |
| 4000 |
size settings that exceeded the available screen size. The text-only |
| 4001 |
interpreters will now limit a banner's size to the available space on |
| 4002 |
the screen when the requested size is too large. |
| 4003 |
|
| 4004 |
<li>The AnonFuncPtr intrinsic class now correctly identifies itself as |
| 4005 |
a subclass of Vector (via ofKind and getSuperclassList). |
| 4006 |
|
| 4007 |
<li>The AnonFuncPtr intrinsic class now compares and hashes by |
| 4008 |
reference, rather than by value as its Vector base class does. |
| 4009 |
|
| 4010 |
<li>The banner function bannerSetSize(), when applied to a text window |
| 4011 |
(BannerTypeText), now takes into account the space used for margins |
| 4012 |
and borders when sizing in "absolute" units. This ensures that if you |
| 4013 |
ask for a height of five rows, for example, then the window will |
| 4014 |
actually be large enough to display five rows in the default font, |
| 4015 |
without any scrolling. In the past, the margins weren't taken into |
| 4016 |
account, so the actual capacity of a banner wasn't necessarily |
| 4017 |
the same as the requested nominal size in absolute units. |
| 4018 |
|
| 4019 |
<li>The run-time symbol table now omits "intrinsic class modifier" |
| 4020 |
objects. These objects have been filtered out of firstObj/nextObj |
| 4021 |
iterations since 3.0.6c; they're now filtered out of the symbol table |
| 4022 |
for the same reasons, and for consistency with firstObj/nextObj. (In |
| 4023 |
the past, these objects appeared as symbols of type object, with names |
| 4024 |
of the form " 99", and with no superclasses. These are internal |
| 4025 |
implementation objects that are meaningless to the game program, so |
| 4026 |
there's no reason for the symbol table to include them.) |
| 4027 |
|
| 4028 |
<li>A problem in the List and String classes caused the VM to crash in |
| 4029 |
certain very rare cases when evaluating properties of constant list or |
| 4030 |
string values. This has been corrected. |
| 4031 |
|
| 4032 |
<li class=last>A bug in the Dictionary intrinsic class's findWord() method |
| 4033 |
sometimes caused strange behavior, most noticeably as corruptions in |
| 4034 |
the values of local variables in the invoking code. The problem only |
| 4035 |
occurred when the method was called in its single-argument form. The |
| 4036 |
problem has been fixed. |
| 4037 |
|
| 4038 |
</ul> |
| 4039 |
|
| 4040 |
|
| 4041 |
<h3>Changes for 3.0.6j (8/2/2003)</h3> |
| 4042 |
|
| 4043 |
<ul> |
| 4044 |
|
| 4045 |
<li>The new TadsObject method setSuperclassList() enables the game |
| 4046 |
program to change an object's superclass list dynamically. The |
| 4047 |
method takes a list giving the new superclass list for the object. |
| 4048 |
|
| 4049 |
<li>It's now legal to explicitly define a 'location' property in an |
| 4050 |
object definition that also uses the '+' notation to set the object's |
| 4051 |
location. The compiler specifically treats an explicit 'location' |
| 4052 |
property setting as overriding the value set with the '+' notation, |
| 4053 |
rather than considering the redefinition a conflict as it did in the |
| 4054 |
past. This allows logically related object definitions to be kept |
| 4055 |
close together in the source code even when some of the objects are |
| 4056 |
part of a location tree and others are not; this happens fairly |
| 4057 |
frequently, because simulation objects sometimes have abstract helper |
| 4058 |
objects that don't participate in the normal location hierarchy. |
| 4059 |
|
| 4060 |
<li>Templates can now include alternative groups that are optional. |
| 4061 |
If any element of an alternative group is marked as optional, then |
| 4062 |
the whole group of alternatives is optional. |
| 4063 |
|
| 4064 |
<li>The new macro perInstance(expr), defined in the system header |
| 4065 |
file tads.h, can be used to define a property in a class such that |
| 4066 |
the property will be set to the value of the expression 'expr' |
| 4067 |
separately for each instance of the class. For each instance, |
| 4068 |
the expression is evaluated the first time that instance's value |
| 4069 |
of the property is accessed, and then stored with that instance. |
| 4070 |
|
| 4071 |
<li>The compiler now has the ability to bundle resource files into |
| 4072 |
the image (.t3) file as part of the main compilation ("t3make") step, |
| 4073 |
without running the "t3res" utility as a separate step. This lets |
| 4074 |
you include resource files in your project's makefile (the .t3m |
| 4075 |
file), which means the makefile can now specify the entire build |
| 4076 |
procedure for most types of projects. To add resources with t3make, |
| 4077 |
add the new "-res" option <i>after</i> all of your source and library |
| 4078 |
modules in the .t3m file, and list your resource files after the "-res" |
| 4079 |
option. The syntax for the resource list following the "-res" option |
| 4080 |
is the same as the "t3res" utility, except that the "-add" option is |
| 4081 |
not allowed (as adding resources is the only possibility). |
| 4082 |
|
| 4083 |
<li>Workbench for Windows now allows you to add a resource file to a |
| 4084 |
project before the resource file exists. To add a resource file that |
| 4085 |
you haven't yet created, use the usual menu command to add a resource |
| 4086 |
file, then type the name of the file into the file selector dialog. |
| 4087 |
The dialog will allow you to type the name of a file that doesn't |
| 4088 |
yet exist. This is handy when you want to include a resource file |
| 4089 |
that won't be created until your pre-initialization code runs, such |
| 4090 |
as the "gameinfo.txt" file. |
| 4091 |
|
| 4092 |
<li>The compiler is now able to determine automatically if relinking |
| 4093 |
is needed due to a change in the set of modules included in the build. |
| 4094 |
This is accomplished by checking a small bit of additional data in the |
| 4095 |
.t3 about the set of object modules involved in the build. (The new |
| 4096 |
information is simply a 32-bit "checksum" of the module source file |
| 4097 |
list, so it adds only four bytes to the image file. It's not enough |
| 4098 |
information to allow a user to recover a list of your source files by |
| 4099 |
reverse-engineering the image file, so you don't have to worry about |
| 4100 |
any possibility that a user could obtain "hints" this way. Because |
| 4101 |
only a checksum is stored, there's a very small possibility that a |
| 4102 |
change to the source file list could result in an identical checksum, |
| 4103 |
in which case the compiler would not notice that relinking is |
| 4104 |
required. The probability of this happening is extremely small, but |
| 4105 |
if you ever suspect it, you can always use the "-al" option to force a |
| 4106 |
relink.) Note that this doesn't affect the compiler's use of file |
| 4107 |
timestamps to determine build dependencies; this is simply an |
| 4108 |
additional check the compiler makes to detect when a new module is |
| 4109 |
added to the build or an old module is removed. |
| 4110 |
|
| 4111 |
<li>The ByteArray intrinsic class has two new methods, readInt() and |
| 4112 |
writeInt(), that make it easy to translate between integer values and |
| 4113 |
byte representations of those values. This is especially useful for |
| 4114 |
reading and writing binary files. The new methods let you read and |
| 4115 |
write integers in 8-bit, 16-bit, and 32-bit sizes, signed or unsigned, |
| 4116 |
and in little-endian or big-endian format. |
| 4117 |
|
| 4118 |
<li>The File intrinsic class has a new method, getFileSize(), which |
| 4119 |
returns the size in bytes of the file. |
| 4120 |
|
| 4121 |
<li>A bug in the File intrinsic class sometimes caused the VM to |
| 4122 |
crash when a read operation was attempted after a seek operation. |
| 4123 |
This has been corrected. |
| 4124 |
|
| 4125 |
<li>The starter game templates now include startup handling for |
| 4126 |
startup-and-restore. When the player launches the interpreter using a |
| 4127 |
saved-game file, the interpreter invokes the startup-and-restore code, |
| 4128 |
which the game must provide in a routine called mainRestore(). The |
| 4129 |
starter templates now include a mainRestore() routine, and handle |
| 4130 |
main() and mainRestore() using a common subroutine called |
| 4131 |
mainCommon(). This change will make it much simpler for authors to |
| 4132 |
include proper startup-and-restore support in their games, by |
| 4133 |
providing a ready-made framework with the necessary code. |
| 4134 |
|
| 4135 |
<li>Fixed a bug in Workbench for Windows: checkboxes in the Project |
| 4136 |
window didn't work for nested libraries; clicking on the checkbox |
| 4137 |
for a nested library simply had no effect. These checkboxes now |
| 4138 |
work properly; clicking on a library checkbox checks or unchecks |
| 4139 |
the library and all of the files within the library. |
| 4140 |
|
| 4141 |
<li>The Win32 character-mode interpreter (t3run.exe) now includes |
| 4142 |
a desktop icon in the executable file. This allows you to use the |
| 4143 |
"-icon" option with maketrx32 to add your own custom icons to games |
| 4144 |
you bundle as executables using the console-mode interpreter. |
| 4145 |
|
| 4146 |
<li>A bug in the regular expression matcher failed to handle the |
| 4147 |
shortest-match closure modifier (specified with a '?' suffix to a |
| 4148 |
'*' or '?' operator) properly. This bug was introduced in the |
| 4149 |
regular expression processor rework in 3.0.6h, and has now been |
| 4150 |
corrected. |
| 4151 |
|
| 4152 |
<li>In certain unusual cases, the debugger incorrectly included a |
| 4153 |
property in property enumerations when the property was actually a |
| 4154 |
method. This happened when a method overrode a property defined as a |
| 4155 |
simple data value in a superclass. The debugger isn't meant to show |
| 4156 |
methods in property enumerations, since invoking a method will |
| 4157 |
naturally invoke any side effects of the method. This has been |
| 4158 |
corrected. |
| 4159 |
|
| 4160 |
<li>In Workbench for Windows, projects created in the root directory |
| 4161 |
of a disk (C:\, D:\, etc) caused a number of problems, including |
| 4162 |
crashes during compilation. These problems have been corrected, so |
| 4163 |
creating a project in a root directory is now safe. |
| 4164 |
|
| 4165 |
<li>In Workbench for Windows, the compiler incorrectly wrote the |
| 4166 |
object files to the working object directory when compiling for |
| 4167 |
release, overwriting the object files for the debug build. This |
| 4168 |
didn't do any harm apart from requiring a full recompile for debugging |
| 4169 |
after any release build, which the compiler automatically sensed and |
| 4170 |
performed, but it caused an unnecessary delay. The compiler now |
| 4171 |
correctly sends release build object files to a temporary directory, |
| 4172 |
so that the debug build object files are retained through a release |
| 4173 |
build. |
| 4174 |
|
| 4175 |
<li>The new-project wizard in Workbench for Windows will no longer |
| 4176 |
accept a source filename that ends in an extension reserved for |
| 4177 |
makefiles or compiler-generated files (.t3m, .t3, .t3o, .t3s). This |
| 4178 |
makes it more difficult to accidentally create a source file that will |
| 4179 |
be overwritten by the compiler or by Workbench with generated files. |
| 4180 |
|
| 4181 |
<li>The compiler will now recompile an object file if the symbol file |
| 4182 |
is more recent. Compilations that fail due to a syntax error can |
| 4183 |
leave a project partially compiled, so that all of the symbol files |
| 4184 |
but not all of the object files have been recompiled. In the past, |
| 4185 |
correcting such an error and then recompiling did not always compile |
| 4186 |
all of the necessary modules. This change ensures that all modules |
| 4187 |
noted as requiring compilation on the first attempt will be noted |
| 4188 |
again on subsequent attempts, even if the first attempt fails part-way |
| 4189 |
through. |
| 4190 |
|
| 4191 |
<li>Due to a bug in the VM, throwing exceptions out of a native-code |
| 4192 |
callback context (such as out of the callback to a Vector or |
| 4193 |
LookupTable iteration method) sometimes caused the VM to lose track of |
| 4194 |
the calling exception handlers; this caused symptoms such as sending |
| 4195 |
the exception to a "catch" block other than the innermost eligible |
| 4196 |
one. This problem tended to show up when an exception was thrown out |
| 4197 |
of a callback context, and then the same exception was thrown again on |
| 4198 |
a later invocation. This has been corrected. |
| 4199 |
|
| 4200 |
<li>If a Vector contains a reference to itself, or to a Vector |
| 4201 |
containing a reference to the first Vector, indirectly to any depth, |
| 4202 |
then an attempt to compare the Vector to another Vector, or an attempt |
| 4203 |
to use the Vector as a key in a LookupTable, will fail with a run-time |
| 4204 |
exception ("maximum equality test/hash recursion depth exceeded"). |
| 4205 |
Since Vector equality comparisons and hash calculations are defined |
| 4206 |
recursively by value, Vectors with direct or indirect self-references |
| 4207 |
cause the equality and hash calculations to recurse infinitely; the |
| 4208 |
Vector class avoids this infinite recursion by throwing the exception |
| 4209 |
when the recursion becomes too deep. Note that this also effectively |
| 4210 |
limits the depth of a Vector tree when used in an equality test or |
| 4211 |
hash value calculation, even if the tree is acyclic; the limit is |
| 4212 |
256 levels. |
| 4213 |
|
| 4214 |
<li>When reading input from a script (using the REPLAY command, for |
| 4215 |
example), the interpreter now ignores morePrompt() calls. This |
| 4216 |
allows script replay to proceed unattended, without unnecessary |
| 4217 |
interactive pauses. |
| 4218 |
|
| 4219 |
<li class=last>In the debugger, if the game was interrupted by a real-time event |
| 4220 |
while the player was editing a command line, and the debugger took |
| 4221 |
control (via a breakpoint, for example) inside the real-time event, |
| 4222 |
and the game was then terminated from within the debugger (while |
| 4223 |
still stepping through the real-time event code) and then later |
| 4224 |
restarted, a bug in the console manager caused strange behavior, |
| 4225 |
sometimes including crashing the debugger. This has been corrected. |
| 4226 |
|
| 4227 |
</ul> |
| 4228 |
|
| 4229 |
|
| 4230 |
|
| 4231 |
<h3>Changes for 3.0.6i (6/15/2003)</h3> |
| 4232 |
|
| 4233 |
<ul> |
| 4234 |
|
| 4235 |
<li>Due to a compiler bug, when a template was defined using the "|" |
| 4236 |
symbol to list a set of alternatives for a token position, object |
| 4237 |
definitions using the template failed to match the last alternative |
| 4238 |
of a set. All alternatives in a set are now properly recognized. |
| 4239 |
|
| 4240 |
<li>The gameinfo.t module has been removed. In its place is a new |
| 4241 |
mechanism in the library that writes the GameInfo file automatically |
| 4242 |
during pre-initialization, based on the definitions in the game's |
| 4243 |
GameID object. |
| 4244 |
|
| 4245 |
<li>The Tokenizer class now gives each rule a name, which is simply a |
| 4246 |
string value by which the rule can be identified. This changes the |
| 4247 |
format of the rule list entries - each rule list entry has the new |
| 4248 |
name value as its first element. Any subclasses or modifications |
| 4249 |
of Tokenizer must use the new rule format. |
| 4250 |
|
| 4251 |
<li class=last>The Tokenizer class has some new methods that allow rules to be |
| 4252 |
added or removed. insertRule(rule, curName, after) inserts the new |
| 4253 |
rule given by 'rule' before or after the existing rule named |
| 4254 |
'curName'; the new rule is inserted before the existing rule if |
| 4255 |
'after' is nil, after the existing rule if 'after' is true. |
| 4256 |
insertRuleAt(rule, idx) inserts the new rule given by 'rule' at the |
| 4257 |
index given by 'idx' in the rule list. deleteRule(name) deletes the |
| 4258 |
existing rule with the given name, and deleteRuleAt(idx) deletes the |
| 4259 |
existing rule at the given index in the rule list. |
| 4260 |
|
| 4261 |
</ul> |
| 4262 |
|
| 4263 |
|
| 4264 |
|
| 4265 |
<h3>Changes for 3.0.6h (6/7/2003)</h3> |
| 4266 |
|
| 4267 |
<ul> |
| 4268 |
|
| 4269 |
<li>The "modify" keyword can now be used to define functions. Modifying |
| 4270 |
a function works just like replacing a function with the "replace" keyword, |
| 4271 |
except that the new function can invoke the previous version of the |
| 4272 |
function by using the "replaced" keyword. Refer to the |
| 4273 |
<a href="sysman/proccode.htm">Procedural Code</a> section of the |
| 4274 |
documentation for details. |
| 4275 |
|
| 4276 |
<li>Two new TadsObject methods, createInstanceOf() and |
| 4277 |
createTransientInstanceOf(), enable a program to dynamically |
| 4278 |
instantiate an object based on multiple superclasses. Refer to the <a |
| 4279 |
href="sysman/tadsobj.htm">TadsObject reference</a> for |
| 4280 |
details of the new methods. |
| 4281 |
|
| 4282 |
<li>The <a href="sysman/objdef.htm">object template</a> syntax has |
| 4283 |
been extended to include optional elements and alternative elements. |
| 4284 |
An element is marked optional by placing a question mark after it; |
| 4285 |
alternative elements are separated by '|' tokens. |
| 4286 |
|
| 4287 |
<li>Several string search and regular expression intrinsics accept a |
| 4288 |
new optional argument specifying the starting index in the string for |
| 4289 |
the search. If the index argument is specified, then the search will |
| 4290 |
start from the given character index; the index value 1 indicates |
| 4291 |
that the search starts from the first character of the string, which |
| 4292 |
is the default if the index parameter is omitted. This change allows |
| 4293 |
algorithms that search for repeated occurrences of a substring or |
| 4294 |
pattern to be written more efficiently, since they won't have to |
| 4295 |
split up the source string to continue searching for additional |
| 4296 |
occurrences. |
| 4297 |
|
| 4298 |
<ul> |
| 4299 |
<li>String.find(str, index?) |
| 4300 |
<li>String.findReplace(origStr, newStr, flags, index?) |
| 4301 |
<li>rexMatch(pat, str, index?) |
| 4302 |
<li>rexSearch(pat, str, index?) |
| 4303 |
<li>rexReplace(pat, str, replacement, flags, index?) |
| 4304 |
</ul> |
| 4305 |
|
| 4306 |
<li>A new banner style flag, BannerStyleMoreMode, causes a banner |
| 4307 |
window to use "MORE" mode. This means that any time text displayed to |
| 4308 |
the banner fills the available vertical space in the banner window, |
| 4309 |
the interpreter will display some sort of prompt to the user, and then |
| 4310 |
wait for the user to acknowledge the prompt. The exact nature of the |
| 4311 |
prompt and acknowledgment varies by platform; usually, the interpreter |
| 4312 |
displays a prompt like "[MORE]" at the bottom of the overflowing |
| 4313 |
window, and waits for the user to press a key. The purpose of MORE |
| 4314 |
mode is to ensure that the user always has a chance to read all of the |
| 4315 |
displayed text before it scrolls off the screen. Note that |
| 4316 |
BannerStyleMoreMode implies BannerStyleAutoVScroll, since it only |
| 4317 |
makes sense to pause for a MORE prompt when new text would cause old |
| 4318 |
text to scroll away, and this only happens when the auto-vscroll style |
| 4319 |
is used. |
| 4320 |
|
| 4321 |
<li>The forEachInstance() function now allows the callback to break |
| 4322 |
out of the iteration loop by throwing a BreakLoopSignal exception. |
| 4323 |
Throwing this exception simply terminates the loop and returns to |
| 4324 |
the caller of forEachInstance(). You can conveniently throw the |
| 4325 |
exception using the "breakLoop" macro (defined in tads.h). |
| 4326 |
|
| 4327 |
<li>A new utility function has been added to the base library (in |
| 4328 |
_main.t): instanceWhich(<i>cls</i>, <i>func</i>). This function |
| 4329 |
iterates over instances of the given class <i>cls</i>, and calling |
| 4330 |
<i>func</i> on each instance; <i>func</i> is a pointer to a function |
| 4331 |
taking one parameter, which is the current instance in the iteration. |
| 4332 |
instanceWhich() returns the first instance for which the callback |
| 4333 |
function <i>func</i> returns a non-nil and non-zero value. Note that |
| 4334 |
the function iterates instances in arbitrary order, so if there are |
| 4335 |
multiple instances of <i>cls</i> for which <i>func</i> returns true, |
| 4336 |
the return value will simple be the first of these visited in the |
| 4337 |
arbitrary iteration order. If <i>func</i> doesn't return a |
| 4338 |
non-nil/non-zero value for any instance of <i>cls</i>, the function |
| 4339 |
returns nil. |
| 4340 |
|
| 4341 |
<li>The setLogFile() function now takes an optional second parameter |
| 4342 |
specifying the type of log file to open or close. The possible values |
| 4343 |
are LogTypeTranscript, to create a transcript of all input and output; |
| 4344 |
and LogTypeCommand, to create a record of only the input commands. |
| 4345 |
The default, if the parameter is omitted, is LogTypeTranscript. |
| 4346 |
|
| 4347 |
<li>The character mapper now accepts the IANA standard names for |
| 4348 |
the various Unicode encodings supported in TADS 3: "UTF-8", "UTF-16BE" |
| 4349 |
(for the 16-bit big-endian encoding), and "UTF-16LE" (for the 16-bit |
| 4350 |
little-endian encoding). These names are case-insensitive, and can |
| 4351 |
be used anywhere a character encoding name is required (#charset, |
| 4352 |
new Charset(), etc). The old non-standard names for the same |
| 4353 |
character sets ("utf8", "unicodeb", and "unicodel") are still accepted |
| 4354 |
as well. |
| 4355 |
|
| 4356 |
<li>The compiler now accepts source files that start with a Unicode |
| 4357 |
UTF-16 byte-order marker (i.e., the "FF FE" or "FE FF" byte sequences) |
| 4358 |
and <i>also</i> specify a #charset directive. The #charset directive |
| 4359 |
in such cases must (1) itself be encoded in the 16-bit Unicode |
| 4360 |
encoding implied by the byte-order marker, and (2) designate the |
| 4361 |
character set name that matches the byte-order marker (so a file |
| 4362 |
encoded in big-endian UTF-16 must have a #charset "utf-16be" |
| 4363 |
directive, and a file encoded in little-endian UTF-16 must have a |
| 4364 |
#charset "utf-16le" directive). The #charset directive is optional in |
| 4365 |
these cases, since the compiler can correctly infer the encoding based |
| 4366 |
on the byte-order marker alone. |
| 4367 |
|
| 4368 |
<li>The compiler now accepts source files that start with a Unicode |
| 4369 |
UTF-8 byte-order marker. The compiler infers that the file is encoded |
| 4370 |
in UTF-8 if it sees this sequence. Note that there is only one valid |
| 4371 |
UTF-8 encoding, so the UTF-8 byte order marker is always the same |
| 4372 |
(i.e., there is no "big-endian" or "little-endian" flavor of UTF-8; |
| 4373 |
there's only UTF-8). A #charset "utf-8" directive is allowed but not |
| 4374 |
required immediately after the UTF-8 three-byte byte-order marker |
| 4375 |
sequence. This change is required because some text editors that save |
| 4376 |
in UTF-8 format write the byte-order marker character at the start of |
| 4377 |
the file. |
| 4378 |
|
| 4379 |
<li>A new compiler option, -quotefname, tells the compiler to quote |
| 4380 |
filenames when reporting the source file location of an error. If |
| 4381 |
this option is specified, the compiler encloses these filenames in |
| 4382 |
double quotes, and "stutters" any double-quote characters that are |
| 4383 |
part of the filenames themselves (that is, each double-quote character |
| 4384 |
that's actually part of a filename is shown as two double-quote |
| 4385 |
characters in a row). This change is intended to make it easier |
| 4386 |
for automated tools to parse the compiler's error message output, |
| 4387 |
by ensuring that filenames can be predictably parsed regardless of |
| 4388 |
any special characters that might appear within. |
| 4389 |
|
| 4390 |
<li>The compiler now displays an initial status message indicating |
| 4391 |
the number of files it will need to build. This is designed for |
| 4392 |
use by automated tools, to give them an estimate of the amount of |
| 4393 |
work to be done; this can be used, for example, to show a progress |
| 4394 |
bar indicator as the compilation proceeds. |
| 4395 |
|
| 4396 |
<li>In the compiler options file (the .t3m file), certain options (-I, |
| 4397 |
-o, -Os, -FL, -FI, -Fs, -Fy, -Fo, -source, -lib) can be specified |
| 4398 |
using URL-style notation, to ensure portability of the .t3m file |
| 4399 |
across different operating systems. In the past, the compiler didn't |
| 4400 |
properly translate these options to local conventions when they |
| 4401 |
contained '/' characters to separate path elements. The compiler |
| 4402 |
now properly converts URL-style paths to local conventions. |
| 4403 |
|
| 4404 |
<li>When an object is defined with an undefined or invalid superclass |
| 4405 |
name, and the object definition uses a template to define property |
| 4406 |
values, the compiler now reports an "undefined superclass" error |
| 4407 |
rather than an error with the template format. In cases where a |
| 4408 |
superclass name is merely misspelled, the compiler will naturally |
| 4409 |
fail to find a matching template for the object, since the misspelled |
| 4410 |
superclass name probably doesn't have any templates associated with |
| 4411 |
it; thus, the template error is secondary to the true problem, which |
| 4412 |
is the misspelled superclass name. This change should make the |
| 4413 |
diagnostics more useful by reporting the true problem rather than the |
| 4414 |
missing-template side effect. |
| 4415 |
|
| 4416 |
<li>Text Grid windows no longer consolidate runs of whitespace; |
| 4417 |
instead, all whitespace written to a text grid window is treated |
| 4418 |
literally. |
| 4419 |
|
| 4420 |
<li>Text Grid windows incorrectly interpreted HTML markups in the |
| 4421 |
text-only interpreters. This has been corrected; text displayed to |
| 4422 |
text grids is now treated literally on all interpreters. |
| 4423 |
|
| 4424 |
<li>Workbench now automatically saves the project (.t3m) file settings |
| 4425 |
upon starting execution of the game in the debugger, and also saves |
| 4426 |
the recent game order whenever a new game is loaded. These measures |
| 4427 |
help reduce the chance of data loss in the event that Workbench |
| 4428 |
crashes while the game is running (which it ideally <i>should</i> |
| 4429 |
never do at all, but until the glorious day when it's perfectly |
| 4430 |
bug-free, this extra saving will at least make crashes a little less |
| 4431 |
painful). |
| 4432 |
|
| 4433 |
<li>Due to a bug, Workbench on Windows did not start up correctly |
| 4434 |
when it was started by double-clicking on a .t3m file from the |
| 4435 |
Windows desktop. (Workbench started with a blank interpreter |
| 4436 |
window, but didn't show the main Workbench IDE window at all.) |
| 4437 |
This has been corrected. |
| 4438 |
|
| 4439 |
<li>A bug in the debugger caused the debugger to crash under certain |
| 4440 |
obscure circumstances. In particular, the crash occurred if the game |
| 4441 |
caused a stack overflow, and the overflow happened to occur on a |
| 4442 |
recursive VM invocation from an intrinsic method (such as when an |
| 4443 |
intrinsic class method invokes an anonymous function callback). This |
| 4444 |
has been corrected. |
| 4445 |
|
| 4446 |
<li>In the past, the compiler generated an output function call for |
| 4447 |
the intial empty portion of a double-quoted string of the form |
| 4448 |
"<<expr>>..." (in other words, a string with an embedded |
| 4449 |
expression immediately after the open quote). The compiler no longer |
| 4450 |
generates this superfluous empty string output operation, slightly |
| 4451 |
reducing code size and execution time. |
| 4452 |
|
| 4453 |
<li>The String intrinsic class failed to enforce the 64k length limit |
| 4454 |
for an individual string in some cases; exceeding the limit caused |
| 4455 |
problems ranging from corrupted string text to crashes. This has |
| 4456 |
been corrected; the interpreter now throws a run-time exception |
| 4457 |
("string is too long") if creating a string (via concatenation, for |
| 4458 |
example) would exceed this limit. The List intrinsic class is |
| 4459 |
likewise more assertive now about enforcing its 64k limit as well. |
| 4460 |
|
| 4461 |
<li>The regular expression functions (rexMatch, rexSearch, rexReplace) |
| 4462 |
were capable of causing the interpreter to crash (with a system stack |
| 4463 |
overflow) when asked to match a pattern to an extremely long string. |
| 4464 |
The exact limits varied by platform according to the amount of system |
| 4465 |
stack space available; on Windows, the problem started occurring with |
| 4466 |
strings about 5,000 characters long, although the exact length was |
| 4467 |
also a function of the complexity of the regular expression pattern. |
| 4468 |
This has been corrected; the regular expression matcher no longer uses |
| 4469 |
a recursive algorithm, so its consumption of system stack space is now |
| 4470 |
fixed and small. The matcher still consumes memory that scales |
| 4471 |
according to the length of the input string and the complexity of the |
| 4472 |
regular expression, since such memory consumption is inherent in the |
| 4473 |
task; but the memory consumed is no longer in the system stack, which |
| 4474 |
means among other things that the matcher can now recover gracefully |
| 4475 |
(by throwing an "out of memory" run-time exception) if it should |
| 4476 |
exhaust available memory while working. |
| 4477 |
|
| 4478 |
<li>In the DOS/Windows version, the executable file bundler |
| 4479 |
(maketrx32) didn't look for the character map library file |
| 4480 |
(cmaplib.t3r) in the correct location; it looked in the directory |
| 4481 |
containing the original interpreter executable rather than the |
| 4482 |
"charmap" subdirectory of the interpreter directory; since the |
| 4483 |
installer puts cmaplib.t3r in the subdirectory, the bundler failed to |
| 4484 |
find the file and omitted it from the bundled executable. The program |
| 4485 |
now looks in the "charmap" subdirectory. |
| 4486 |
|
| 4487 |
<li>A bug caused the compiler to crash on certain types of syntax |
| 4488 |
errors. If a long string (around 1,000 bytes or longer) was |
| 4489 |
misplaced in a few specific contexts, the error message generator |
| 4490 |
overflowed an internal buffer trying to include the text of the |
| 4491 |
string in the error message. This should no longer occur. |
| 4492 |
|
| 4493 |
<li>The compiler now flags an error if a grammar production defines |
| 4494 |
more than 65,535 alternatives. This limit is imposed by the .t3 file |
| 4495 |
format for grammar rules, but it's undesirable to get anywhere close |
| 4496 |
to the limit because of performance cost. It's possible to exceed |
| 4497 |
the limit with relatively concise grammar rule definitions, because |
| 4498 |
the compiler expands the permutations of rules defined with '|' |
| 4499 |
alternatives. Grammar rules that contain complex sets of |
| 4500 |
permutations using '|' alternatives should generally be rewritten |
| 4501 |
using sub-productions, which will allow equally complex rules without |
| 4502 |
the overhead of expanding the permutations. |
| 4503 |
|
| 4504 |
<li>In reflect.t, reflectionServices.valToSymbol() can now correctly |
| 4505 |
identify the reflectionServices object itself. (Due to a bug, this |
| 4506 |
caused a run-time error in the past.) |
| 4507 |
|
| 4508 |
<li class=last>In reflect.t, reflectionServices.valToSymbol(), looking up an unnamed |
| 4509 |
object now returns a string giving the superclass list of the object, |
| 4510 |
if the superclass names are available. The format of the return value |
| 4511 |
is now '(obj:sc1,sc2)', where 'sc1' and 'sc2' are the names of the |
| 4512 |
superclasses (naturally, more or fewer superclass names will appear |
| 4513 |
according to the actual number of superclasses of the object). The |
| 4514 |
string 'obj' is literally present. If none of the superclasses have |
| 4515 |
names, then the traditional result, '(obj)', is returned. If some |
| 4516 |
superclasses have names but others don't, then the full list will |
| 4517 |
be returned, with '(anonymous)' used for any unnamed superclass. |
| 4518 |
|
| 4519 |
</ul> |
| 4520 |
|
| 4521 |
|
| 4522 |
|
| 4523 |
<h3>Changes for 3.0.6g (4/12/2003)</h3> |
| 4524 |
|
| 4525 |
<ul> |
| 4526 |
|
| 4527 |
<li>The new interpreter option -R lets you specify the root folder |
| 4528 |
for individual resources. By default, the root resource folder is |
| 4529 |
the folder that contains the image (.t3) file. If -R is specified, |
| 4530 |
then the interpreter will look for resources in the given folder when |
| 4531 |
they can't be found in the image file itself or in a resource bundle |
| 4532 |
file. Note that this isn't a search list; only one -R option can be |
| 4533 |
in effect. |
| 4534 |
|
| 4535 |
<li>Added a new method, isRoundTripMappable(), to the |
| 4536 |
<a href="sysman/charset.htm">CharacterSet intrinsic class</a>. This new |
| 4537 |
method provides an easy way to determine if a set of characters |
| 4538 |
has an exact, one-to-one mapping in a given local character set. |
| 4539 |
|
| 4540 |
<li>The compiler now warns when a grammar rule ends with an empty |
| 4541 |
alternative, or is completely empty. Empty rules at the top level of |
| 4542 |
a grammar rule are uncommon, and it's easy to accidentally leave a '|' |
| 4543 |
at the end of a rule, especially while actively defining new rules. |
| 4544 |
To eliminate this new warning, you can use an empty pair of |
| 4545 |
parentheses, "()", to explicitly indicate an empty rule. This warning |
| 4546 |
only applies to the outermost grouping level of a rule; empty rules |
| 4547 |
within parenthesized portions of rules are not flagged. |
| 4548 |
|
| 4549 |
<li>Fixed a problem in the console formatter that caused command lines |
| 4550 |
read from a command input file to be copied into a script output file |
| 4551 |
twice. |
| 4552 |
|
| 4553 |
<li>Fixed a problem in the Dictionary class that caused dynamic |
| 4554 |
vocabulary to be forgotten if you saved a game to a file, ended the |
| 4555 |
interpreter session, started a new interpreter session, restored the |
| 4556 |
file saved earlier, saved again to a second file, and then later |
| 4557 |
restored the second file. (The problem was that the Dictionary object |
| 4558 |
was not being marked as being in need of being saved again after it |
| 4559 |
was restored in the new session, so the second save didn't include the |
| 4560 |
dynamic vocabulary entries. The Dictionary object is now properly |
| 4561 |
marked as being in need of saving after being restored.) |
| 4562 |
|
| 4563 |
<li>Fixed a problem that caused the Object.propDefined() method |
| 4564 |
to yield incorrect results when called on an intrinsic class object |
| 4565 |
to retrieve information on methods added to the intrinsic class |
| 4566 |
with 'modify'. The information returned was inconsistent with |
| 4567 |
that returned from getPropList(). This has been corrected; |
| 4568 |
the returned information should now be fully consistent. |
| 4569 |
|
| 4570 |
<li>Fixed a problem that caused sporadic crashes in the Windows |
| 4571 |
debugger when an expression including the '&' operator applied |
| 4572 |
to an undefined symbol was evaluated interactively. This crashiness |
| 4573 |
should no longer occur. |
| 4574 |
|
| 4575 |
<li>Fixed two problems in the text-only interpreters relating to |
| 4576 |
"&" entities. First, a few valid entity names were not |
| 4577 |
recognized at all, causing the interpreter to show the entity |
| 4578 |
source text (i.e., the "&" code itself). Second, entities |
| 4579 |
whose names weren't properly terminated (with a semicolon, ";") |
| 4580 |
had the last letter of their name incorrectly added to the display |
| 4581 |
after the entity itself. These problems have been corrected. |
| 4582 |
|
| 4583 |
<li>Fixed a couple of bugs that caused interpreter crashes when |
| 4584 |
running with "unicodeb" or "unicodel" character set mappings. |
| 4585 |
|
| 4586 |
<li class=last>The versions of the interpreters that run in a Windows command |
| 4587 |
prompt window now correctly remove the console window's scrollbars in |
| 4588 |
all cases on Windows NT, 2000, and XP. In the past, the interpreters |
| 4589 |
<i>usually</i> did this, but in some cases missed the scrollbars and |
| 4590 |
left them intact. (Console scrollbars appear when the console |
| 4591 |
properties are set so that the console has a "screen buffer" larger |
| 4592 |
than the actual console window. This feature isn't available on the |
| 4593 |
Windows 9x platforms, only on the NT branch, which includes 2000 and |
| 4594 |
XP.) Leaving the scrollbars active created the confusing situation |
| 4595 |
that the area of the console containing the interpreter window could |
| 4596 |
be scrolled off the screen. The scrollbars are now correctly removed |
| 4597 |
under all conditions. This affects t3run.exe and tr32.exe. |
| 4598 |
|
| 4599 |
|
| 4600 |
</ul> |
| 4601 |
|
| 4602 |
|
| 4603 |
<h3>Changes for 3.0.6f (3/23/2003)</h3> |
| 4604 |
|
| 4605 |
<ul> |
| 4606 |
|
| 4607 |
<li>Fixed a problem in the regular expression parser that misinterpreted |
| 4608 |
character class expressions involving single Unicode characters outside |
| 4609 |
of the plain ASCII range (for example: '<\u2019|\u201D>'). The |
| 4610 |
regular expression compiler treated such expressions as invalid; it |
| 4611 |
now handles them correctly. |
| 4612 |
|
| 4613 |
<li>Added a couple of new compiler options to allow more control over |
| 4614 |
special system paths: |
| 4615 |
|
| 4616 |
<ul> |
| 4617 |
<li><tt>-FI <i>path</i></tt>: overrides the standard system include |
| 4618 |
directory with the given path. The compiler normally uses a path that |
| 4619 |
depends on the operating system and installation configuration. Note |
| 4620 |
that this option doesn't set up a search list the way -I does; there's |
| 4621 |
only a single system include directory in effect at any given time. |
| 4622 |
|
| 4623 |
<li class=last>i><tt>-FL <i>path</i></tt>: overrides the standard system library |
| 4624 |
source directory with the given path. The standard library path depends |
| 4625 |
on the operating system and installation configuration. As with -FI, |
| 4626 |
there's only a single system library directory in effect at one time. |
| 4627 |
</ul> |
| 4628 |
|
| 4629 |
</ul> |
| 4630 |
|
| 4631 |
|
| 4632 |
<h3>Changes for 3.0.6e (3/16/2003)</h3> |
| 4633 |
|
| 4634 |
<ul> |
| 4635 |
|
| 4636 |
<li>A new HTML tag is now recognized: <NOLOG>. This is a |
| 4637 |
container tag (so each <NOLOG> must have a corresponding |
| 4638 |
</NOLOG> tag); it delimits text that is to be displayed only |
| 4639 |
on the interactive console, not in any log file (transcript) being |
| 4640 |
made. The tag has no effect on the display. |
| 4641 |
|
| 4642 |
<li>The getPropList() method previously only returned static methods |
| 4643 |
when called on intrinsic class objects (such as TadsObject or |
| 4644 |
BigNumber). This has been changed so that the method now returns both |
| 4645 |
static and non-static methods. This change clarifies the meaning of |
| 4646 |
getPropList() when called on an intrinsic class object: the method |
| 4647 |
returns the full set of properties that the class defines for |
| 4648 |
<b>instances</b> of the intrinsic class, which may not necessarily be |
| 4649 |
methods that are meaningful when called on the intrinsic class object |
| 4650 |
itself. This change is necessary for consistency throughout the |
| 4651 |
class hierarchy for the reflection mechanism, so that a program can |
| 4652 |
traverse a class tree to create an exhaustive list of properties on |
| 4653 |
a class, including those inherited from intrinsic superclasses. |
| 4654 |
|
| 4655 |
<li>In the output formatter, the effects of the "\^" and "\v" |
| 4656 |
sequences are now limited to the plain text outside of HTML markups. |
| 4657 |
In the past, if an HTML tag or entity appeared after a "\^" or "\v" |
| 4658 |
sequence and before any alphabetic character, the case conversion |
| 4659 |
effect was applied to the first character of the tag or entity name. |
| 4660 |
Entity names are case-sensitive, so this had the potential to |
| 4661 |
invalidate an entity name; in addition, whether a tag or entity name |
| 4662 |
interceded, the case conversion effect was effectively lost, since it |
| 4663 |
was misapplied to the HTML markup. Now, with this output formatter |
| 4664 |
change, the case conversion effect of "\^" and "\v" sequences skips |
| 4665 |
past any HTML markups, so the case conversion is applied to the next |
| 4666 |
plain text. |
| 4667 |
|
| 4668 |
<li>Fixed a problem in the console output formatter that caused |
| 4669 |
explicit blank line sequences to be ignored in some cases immediately |
| 4670 |
after reading input. |
| 4671 |
|
| 4672 |
<li>Fixed a compiler problem that caused spurious syntax errors in any |
| 4673 |
object definition that used a template in which a list element |
| 4674 |
followed a single-quoted string element. |
| 4675 |
|
| 4676 |
<li>Fixed a compiler bug that caused spurious syntax error reports |
| 4677 |
in certain cases involving multi-line strings as macro arguments. |
| 4678 |
If code involving a macro spanned multiple lines, and the macro |
| 4679 |
arguments included a string spanning multiple lines, and the string |
| 4680 |
was part of a larger expression that started with a non-string token, |
| 4681 |
the compiler sometimes misinterpreted the string as ending before its |
| 4682 |
actual terminating quote. This resulted in spurious syntax errors, |
| 4683 |
as the compiler thought some of the string's continuation lines were |
| 4684 |
non-string tokens. This has been corrected. |
| 4685 |
|
| 4686 |
<li class=last>Fixed a bug in the console output formatter that allowed too many |
| 4687 |
lines to be displayed between "MORE" prompts in some cases, which |
| 4688 |
caused text to scroll off the top of the screen before the player |
| 4689 |
could read it. (The problem was introduced with the typographical |
| 4690 |
spaces in 3.0.6b.) |
| 4691 |
|
| 4692 |
</ul> |
| 4693 |
|
| 4694 |
|
| 4695 |
<h3>Changes for 3.0.6d (2/23/2003)</h3> |
| 4696 |
|
| 4697 |
<ul> |
| 4698 |
|
| 4699 |
<li>Fixed a problem that caused the debugger to crash when attempting |
| 4700 |
to stop a running game when the game was suspended in the debugger at |
| 4701 |
a run-time exception that was thrown from within a callback invoked |
| 4702 |
from a system intrinsic method (for example, from a callback |
| 4703 |
invoked by the List.forEach() method). This has been corrected. |
| 4704 |
|
| 4705 |
<li>The inputKey() intrinsic function didn't return the correct |
| 4706 |
square-bracket code for special keys (arrow keys, function keys, and |
| 4707 |
so on) due to a bug introduced in an earlier patch release (3.0.6a). |
| 4708 |
This is now fixed. |
| 4709 |
|
| 4710 |
<li class=last>Fixed a problem in several methods of the Dictionary intrinsic |
| 4711 |
class (addWord, removeWord, forEachWord) that sometimes caused stack |
| 4712 |
overflows when calling these methods. Fixed the same problem in some |
| 4713 |
File methods (setCharacterSet, closeFile, setPos, setPosEnd). |
| 4714 |
|
| 4715 |
</ul> |
| 4716 |
|
| 4717 |
|
| 4718 |
|
| 4719 |
<h3>Changes for 3.0.6c (2/1/2003)</h3> |
| 4720 |
|
| 4721 |
<ul> |
| 4722 |
|
| 4723 |
<li>Defining a template for an object class no longer creates an |
| 4724 |
external reference to the object, so it's now legal to define |
| 4725 |
templates for objects that are never defined in any of the |
| 4726 |
modules linked into a program. In the past, merely defining a |
| 4727 |
template for an object created a reference to the object. This |
| 4728 |
change makes it easier to create more modular subsystems whose |
| 4729 |
components can be linked a la carte, since templates included in |
| 4730 |
a header for the subsystem won't by themselves drag in the modules |
| 4731 |
where the template objects are defined. An object mentioned in |
| 4732 |
a template will now be required at link time only if the template |
| 4733 |
is actually used to create instances of the mentioned object. |
| 4734 |
|
| 4735 |
<li>The 'modify grammar' statement now accepts an empty grammar rule |
| 4736 |
list to indicate that the rules defined in the base grammar |
| 4737 |
definition are to be retained. This change makes it possible to |
| 4738 |
modify the properties and/or methods of a grammar rule in isolation, |
| 4739 |
without changing the syntax for the rule. In the past, to modify |
| 4740 |
only properties or methods of a grammar rule, it was necessary to |
| 4741 |
repeat the entire rule list from the base grammar definition, since |
| 4742 |
the rule list in the 'modify grammar' statement always superseded the |
| 4743 |
base object's rule list. |
| 4744 |
|
| 4745 |
<li>The firstObj/nextObj object iteration functions now filter out |
| 4746 |
"intrinsic class modifier" objects. These are purely internal |
| 4747 |
implementation objects in the VM; they serve as the repositories of |
| 4748 |
properties and methods attached via the "modify" keyword to intrinsic |
| 4749 |
classes, and are for all intents and purposes parts of the intrinsic |
| 4750 |
classes they modify. There is no benefit in enumerating them as |
| 4751 |
separate objects, and doing so created some confusing special cases |
| 4752 |
for code using the reflection mechanisms, so they've been eliminated |
| 4753 |
from the firstObj/nextObj results. |
| 4754 |
|
| 4755 |
<li>The "intrinsic class" declaration syntax now allows the superclass |
| 4756 |
of the intrinsic class to be specified. This information is largely |
| 4757 |
for documentary purposes; intrinsic classes are built into the VM, so |
| 4758 |
the "intrinsic class" syntax doesn't actually define intrinsic classes |
| 4759 |
but merely tells the compiler about the interfaces of the intrinsic |
| 4760 |
classes being used. The system header files have been changed to take |
| 4761 |
advantage of this new feature to provide superclass information for |
| 4762 |
the intrinsic classes they declare. The one immediate effect of this |
| 4763 |
change is that the compiler is now able to enforce the rule against |
| 4764 |
using "modify" with intrinsic methods of intrinsic classes, and can |
| 4765 |
do so for the entire inheritance tree; in the past, the compiler was |
| 4766 |
unable to enforce this rule for inherited intrinsic methods, since it |
| 4767 |
didn't have information on the inheritance relationships among |
| 4768 |
intrinsic classes. |
| 4769 |
|
| 4770 |
<li>Workbench for Windows had a problem that, under certain |
| 4771 |
circumstances, caused the same directory to be added to the "include" |
| 4772 |
path in the build settings every time a project was opened. This |
| 4773 |
happened when a file in the "include files" section of the project |
| 4774 |
had a parent-relative path (a path starting with ".."). This should |
| 4775 |
no longer occur. |
| 4776 |
|
| 4777 |
<li>Workbench for Windows had a problem that failed to recognize the |
| 4778 |
library-relative path of a header file associated with a nested |
| 4779 |
library (that is, a library referenced from within another library; |
| 4780 |
for example, en_us.tl is nested within adv3.tl in the standard library |
| 4781 |
configuration). This sometimes caused such header files to be listed |
| 4782 |
in the "include files" section of the project window with absolute or |
| 4783 |
parent-relative paths, when they should have been listed without any |
| 4784 |
path prefix, since Workbench automatically looks for header files in |
| 4785 |
the directories associated with libraries included in the build. |
| 4786 |
The unnecessary path prefixes caused other undesirable side effects, |
| 4787 |
such as including superfluous include paths in the build settings. |
| 4788 |
Workbench should now correctly identify headers associated with nested |
| 4789 |
libraries. |
| 4790 |
|
| 4791 |
<li>Workbench for Windows did not properly initialize the "recent |
| 4792 |
projects" menu when configured to load the most recent game at |
| 4793 |
startup. On the initial load at startup, the list of recent projects |
| 4794 |
was always shown with full, absolute directory paths, rather than with |
| 4795 |
paths relative to the initially loaded project's directory. (This was |
| 4796 |
purely cosmetic, but was inconsistent, since the recent projects were |
| 4797 |
always shown with paths relative to the active project after opening |
| 4798 |
another project subsequently.) This has been corrected. |
| 4799 |
|
| 4800 |
<li class=last>A problem in the command-line option parser prevented some |
| 4801 |
combined TADS 2/3 interpreters from accepting the "-cs" (character |
| 4802 |
set) option for TADS 3 games. This is now fixed. |
| 4803 |
|
| 4804 |
</ul> |
| 4805 |
|
| 4806 |
|
| 4807 |
|
| 4808 |
<h3>Changes for 3.0.6b (12/15/2002)</h3> |
| 4809 |
|
| 4810 |
<ul> |
| 4811 |
|
| 4812 |
<li>This version substantially overhauls the output formatter's |
| 4813 |
word-wrapping rules. The changes are designed to give the game much |
| 4814 |
greater control over the way that text lines are wrapped to fit the |
| 4815 |
available horizontal space. The changes should be relatively |
| 4816 |
transparent to existing code, because the new features mostly add |
| 4817 |
optional new controls, but use defaults that provide roughly the old |
| 4818 |
TADS 2 behavior. The changes are implemented in both the text-only |
| 4819 |
and HTML interpreters. The new text-wrapping rules are described in |
| 4820 |
detail in the <a href="sysman/fmt.htm">Formatting</a> documentation, but |
| 4821 |
here's a summary of the changes: |
| 4822 |
|
| 4823 |
<ul> |
| 4824 |
|
| 4825 |
<li>The game can switch at any between "word-wrap" and "character-wrap" |
| 4826 |
modes. In word-wrap mode, text can be broken only at word boundaries; |
| 4827 |
in character-wrap mode, text can be broken between almost any two |
| 4828 |
characters. The modes are selected with the new tag <WRAP>: |
| 4829 |
<WRAP WORD> sets word-wrap mode, and <WRAP CHAR> |
| 4830 |
sets character-wrap mode. |
| 4831 |
|
| 4832 |
<li>The formatter recognizes the Unicode character \uFEFF (HTML |
| 4833 |
entity "&zwnbsp;"), the zero-width non-breaking space. This character |
| 4834 |
doesn't show up on the display, but it tells the formatter not to break |
| 4835 |
the line between the two adjacent characters, even if the text-wrapping |
| 4836 |
rules would otherwise permit it. |
| 4837 |
|
| 4838 |
<li>The formatter recognizes the Unicode character \u200B |
| 4839 |
("&zwsp;"), the zero-width space. This character doesn't show |
| 4840 |
up on the display, but it tells the formatter that it can break the |
| 4841 |
line between the two adjacent characters, even if the wrapping rules |
| 4842 |
wouldn't ordinarily allow a line break there. |
| 4843 |
|
| 4844 |
<li>The formatter recognizes several of the Unicode special-width |
| 4845 |
space characters (en space, em space, etc). All of these are treated |
| 4846 |
as quoted space, in that they don't combine with adjacent runs of |
| 4847 |
ordinary whitespace. These spaces allow finer control over visual |
| 4848 |
spacing, which facilitates a more typographical appearance in the |
| 4849 |
HTML interpreters. |
| 4850 |
|
| 4851 |
<li>The "soft hyphen" character, \u00AD (HTML "&shy;") is now |
| 4852 |
accepted by the formatter. This is invisible in most cases, but |
| 4853 |
it tells the formatter that it can break the line by hyphenating. |
| 4854 |
If the formatter does break a line at a soft hyphen, it displays |
| 4855 |
the soft hyphen as an ordinary visible hyphen. |
| 4856 |
|
| 4857 |
</ul> |
| 4858 |
|
| 4859 |
<li class=last>Added the new "log file console." This is a special kind of |
| 4860 |
console object that has no display, but simply captures all of its |
| 4861 |
output to a log file. This can be used to capture game output to a |
| 4862 |
file, using the standard output formatting (including HTML |
| 4863 |
interpretation and word wrapping), without displaying anything to the |
| 4864 |
player. Refer to the <a href="sysman/tadsio.htm">tads-io function set |
| 4865 |
documentation</a> for details. |
| 4866 |
|
| 4867 |
</ul> |
| 4868 |
|
| 4869 |
|
| 4870 |
|
| 4871 |
<h3>Changes for 3.0.6a (11/23/2002)</h3> |
| 4872 |
|
| 4873 |
<ul> |
| 4874 |
|
| 4875 |
<li>The new <tt>#pragma newline_spacing(on|off)</tt> directive lets |
| 4876 |
the program control the treatment of newlines in strings. By default, |
| 4877 |
newline spacing is set to "on": when a newline character is found within |
| 4878 |
a string, the compiler converts the newline plus any whitespace that |
| 4879 |
immediately follows to a single space character. When newline spacing |
| 4880 |
is set to "off", the compiler instead simply strips out the newline |
| 4881 |
and any immediately following whitespace. Setting newline spacing |
| 4882 |
to "off" is desirable in some languages, such as Chinese, where |
| 4883 |
whitespace isn't conventionally used as a token separator in |
| 4884 |
ordinary text; turning off newline spacing can make it easier to |
| 4885 |
write code in these cases, because it allows strings to be split over |
| 4886 |
several lines without introducing unwanted whitespace. |
| 4887 |
|
| 4888 |
<li>The compiler now allows macro substitutions in library (.tl) files. |
| 4889 |
In a library file, the value of a preprocessor symbol defined with the |
| 4890 |
-D option can be substituted into the text of the library file using |
| 4891 |
the notation "$(VARNAME)": the variable name is enclosed in parentheses |
| 4892 |
preceded by a dollar sign. The adv3 library (adv3.tl) uses this |
| 4893 |
capability to parameterize the language-specific library and message |
| 4894 |
file selection. See <a href="sysman/build.htm">Compiling and Linking</a> |
| 4895 |
for more information. |
| 4896 |
|
| 4897 |
<li>The text-only interpreters now treat "&nbsp;" as a true non-breaking |
| 4898 |
space. (In the past, "&nbsp;" was treated the same as "\ ", the |
| 4899 |
quoted space: the formatter did not combine such a space with other |
| 4900 |
adjacent whitespace, or remove it from the start of a line, but <i>did</i> |
| 4901 |
allow a line break to occur at an "&nbsp;" character.) |
| 4902 |
|
| 4903 |
<li>On Workbench for Windows, the Build Settings dialog has a new page |
| 4904 |
that lets you set the directory paths to use for object files and symbol |
| 4905 |
files. This new page's tab is labeled "Temp Files," as the symbol and |
| 4906 |
object files are intermediate files that the compiler produces and |
| 4907 |
reads during compilation. (These settings correspond to the -Fy and -Fs |
| 4908 |
compiler options.) |
| 4909 |
|
| 4910 |
<li>When Workbench for Windows creates a new project, it automatically |
| 4911 |
creates a subfolder (of the folder containing the project file) to |
| 4912 |
store the project's object and symbol files. The new subfolder is |
| 4913 |
called "obj". Workbench initializes the new project's object file and |
| 4914 |
source file path options to the new subfolder. The purpose of using |
| 4915 |
the subfolder is to keep the compiler-generated intermediate |
| 4916 |
files separate from the project's source files, to make it easier to |
| 4917 |
manage the files associated with the project. |
| 4918 |
|
| 4919 |
<li>A portability bug that caused interpreter crashes on some platforms |
| 4920 |
(notably Solaris) has been fixed. (This bug only occurred when the |
| 4921 |
interpreter was compiled with certain C++ compilers, and prevented |
| 4922 |
the interpreter from running any games.) |
| 4923 |
|
| 4924 |
<li>The 'inherited' operator did not work properly to inherit a |
| 4925 |
modified intrinsic class method from the intrinsic base class of a |
| 4926 |
modified intrinsic class. For example, if a method defined with |
| 4927 |
"modify TadsObject" used 'inherited' to inherit, and a method of the |
| 4928 |
same name was defined with "modify Object", the Object modifier method |
| 4929 |
was not properly inherited. This has been corrected. |
| 4930 |
|
| 4931 |
<li>The new compiler option "-errnum" causes the compiler to display |
| 4932 |
the numeric error code for each warning or error message. By default, |
| 4933 |
the compiler does not display the numeric codes for errors, because |
| 4934 |
the code is mostly for the compiler's own use; however, the new option |
| 4935 |
allows the user to show these codes if desired, for purposes such as |
| 4936 |
cross-referencing with documentation. |
| 4937 |
|
| 4938 |
<li>The new compiler option "-w-<i>nnn</i>" causes the compiler to |
| 4939 |
suppress the warning message identified by <i>nnn</i>, which is the |
| 4940 |
compiler's internal numeric code for the warning. When this option is |
| 4941 |
used, the compiler will not display any warnings of the given type, |
| 4942 |
and will not include any such warnings in its summary error count. |
| 4943 |
This option can be repeated to suppress multiple types of warning |
| 4944 |
messages. Only warnings (and pedantic warnings) can be disabled with |
| 4945 |
this option; specifying codes for errors of severity greater than |
| 4946 |
warnings will have no effect. The complementary option |
| 4947 |
"-w+<i>nnn</i>" can be used to explicitly enable a warning; by |
| 4948 |
default, all warnings are enabled, so the only reason this option |
| 4949 |
would be needed is to enable a warning previously removed with |
| 4950 |
"-w-<i>nnn</i>" on the same command line, which might sometimes be |
| 4951 |
useful with shell aliases or command scripts. Note also that the |
| 4952 |
"-w+<i>nnn</i>" option <b>cannot</b> be used to selectively enable |
| 4953 |
certain pedantic warnings without enabling pedantic mode; pedantic |
| 4954 |
warnings are an entirely separate class of messages from regular |
| 4955 |
warning, and can only be enabled as a group using the "-w2" option. |
| 4956 |
Once pedantic warnings are generally enabled, you can use |
| 4957 |
"-w-<i>nnn</i>" to disable specific pedantic warnings you wish to |
| 4958 |
suppress. + <li>When searching for an external resource file (.3r0, |
| 4959 |
.3r1, etc.), the interpreter now looks for a file with both a |
| 4960 |
lower-case and upper-case version of each suffix. This is intended to |
| 4961 |
make the naming convention more flexible on case-sensitive file |
| 4962 |
systems, such as Unix; on systems with case-insensitive file naming, |
| 4963 |
such as Windows or Mac, this change has no effect. |
| 4964 |
|
| 4965 |
<li>Added support for mixed multi-byte character sets to the character |
| 4966 |
mapper; this allows the compiler to read source files encoded in |
| 4967 |
multi-byte character sets, and allows the interpreters to use local |
| 4968 |
system character sets with multi-byte encodings, both for displaying |
| 4969 |
text on the screen and reading text from the keyboard. A number of |
| 4970 |
widely-used character sets for Asian languages use this type of |
| 4971 |
character set (Windows systems localized for Chinese and Japanese use |
| 4972 |
multi-byte character sets, for example). Such character sets have |
| 4973 |
always been supported in the character map compiler (mkchrtab), but |
| 4974 |
the character mapper used in the compiler and VM did not implement the |
| 4975 |
mapping logic for these types of character sets. Double-byte |
| 4976 |
character sets are now fully supported; the character mapper can now |
| 4977 |
handle any character set that uses two-byte sequences for all of its |
| 4978 |
characters (usually called double-byte character sets), or that uses a |
| 4979 |
mixture of one-byte and two-byte sequences (usually known as |
| 4980 |
multi-byte or mixed-multi-byte character sets). |
| 4981 |
|
| 4982 |
<li>In Workbench for Windows, the Debug Log window displayed its |
| 4983 |
contents using the same color settings as in the main game window. |
| 4984 |
The Debug Log window now uses the color settings from the Workbench |
| 4985 |
"options" dialog, the same as source file windows. |
| 4986 |
|
| 4987 |
<li>In the Build Settings dialog in Workbench for Windows, on the |
| 4988 |
Installer page, a new field allows overriding the default character |
| 4989 |
mapping library (cmaplib.t3r) with a custom mapping library. This |
| 4990 |
is especially useful for authors working in Asian languages; the |
| 4991 |
default character map library includes mappings for the common |
| 4992 |
character sets for most European languages, but does not include |
| 4993 |
the Asian character sets because of the large size of these sets. |
| 4994 |
Authors working in languages which require character sets not included |
| 4995 |
in the default mapping library can create their own mapping file or |
| 4996 |
files (see the <a href="sysman/charmap.htm">character mapping documentation</a>), |
| 4997 |
then bundle the file(s) into a custom library (a .t3r file) using |
| 4998 |
the <tt>t3res</tt> tool. Specify this .t3r file in the new |
| 4999 |
Character Map Library field, and the installer will automatically |
| 5000 |
bundle this file into your game's executable file when building |
| 5001 |
the install set. |
| 5002 |
|
| 5003 |
<li>Fixed a problem in Workbench for Windows that caused Workbench to |
| 5004 |
reload a library (.tl) file every time Workbench became the foreground |
| 5005 |
application (i.e., its main window was activated after another |
| 5006 |
application had been in the foreground), if the library was ever |
| 5007 |
modified after being loaded in Workbench in that session. |
| 5008 |
|
| 5009 |
<li>Fixed a problem in the UTF-8 character mapper that could have |
| 5010 |
caused problems in rare cases when reading from a text file encoded |
| 5011 |
in UTF-8. The mapper did not correctly figure the byte length of the last |
| 5012 |
character when reading a three-byte character at the end of the buffer and |
| 5013 |
the first two of the three bytes was read into the buffer. (This problem |
| 5014 |
was extremely unlikely to actually occur in practice, but in any case it's |
| 5015 |
now fixed.) |
| 5016 |
|
| 5017 |
<li>Fixed a problem in the GrammarProd class that caused interpreter |
| 5018 |
crashes under certain circumstances. In particular, if a grammar rule |
| 5019 |
was matched with a '*' element in the rule, and the matched input string |
| 5020 |
had exactly six tokens, an internal memory corruption led to an interpreter |
| 5021 |
crash. This has been corrected. |
| 5022 |
|
| 5023 |
<li>Fixed the t3make error message "error creating image file" to properly |
| 5024 |
show the image file name as part of the message. This message incorrectly |
| 5025 |
showed the filename as "s", regardless of the actual name of the image. |
| 5026 |
|
| 5027 |
<li class=last>Fixed a problem in the DOS character-mode interpreters (t3run and |
| 5028 |
tr32) that caused start-up error messages (in particular, errors |
| 5029 |
relating to loading the .t3 file, such as a "game file not found" |
| 5030 |
error) to be cleared from the display before the user had a chance to |
| 5031 |
see them. |
| 5032 |
|
| 5033 |
</ul> |
| 5034 |
|
| 5035 |
|
| 5036 |
|
| 5037 |
<h3>Changes for 3.0.5 (09/22/2002)</h3> |
| 5038 |
|
| 5039 |
<ul> |
| 5040 |
|
| 5041 |
<li>The <BANNER> tag is no longer allowed for T3 HTML programs. |
| 5042 |
T3 games should use the banner API instead. (The <BANNER> |
| 5043 |
tag has been removed entirely because it interacts poorly with |
| 5044 |
the banner API. The adv3 library uses the banner API for the |
| 5045 |
status line, so this essentially forces programs using the library |
| 5046 |
to do likewise. To reduce the potential for any confusion that |
| 5047 |
could result from games inadvertantly mixing banner API calls and |
| 5048 |
banner tags, we simply disallow banner tags entirely, to ensure |
| 5049 |
that all T3 programs use the banner API uniformly.) For the moment, |
| 5050 |
<BANNER> tags are actually disallowed only when the banner API |
| 5051 |
is supported by an HTML interpreter; for HTML interpreters that don't |
| 5052 |
yet support the banner API, the tags are still allowed. This support |
| 5053 |
will be withdrawn soon, though; we're just waiting until we're sure |
| 5054 |
that banner API support is available on all HTML interpreters. |
| 5055 |
|
| 5056 |
<li>The compiler now assumes that each filename and folder name |
| 5057 |
specified in a ".t3m" file (a compiler makefile) is given relative to |
| 5058 |
the folder location of the .t3m file itself. This makes the compiler |
| 5059 |
essentially independent of the working directory when using a .t3m |
| 5060 |
file, because the location of the .t3m file effectively becomes the |
| 5061 |
working directory for any file and folder paths specified within. |
| 5062 |
This treatment naturally does not apply to any filename given in a |
| 5063 |
.t3m file with an absolute path (for example, a Unix path that starts |
| 5064 |
with "/", an MS-DOS path that starts with "\" or a drive letter, or a |
| 5065 |
Macintosh path that starts with a volume name), since an absolute path |
| 5066 |
is already independent of the working directory. |
| 5067 |
|
| 5068 |
<li class=last>The compiler now keeps information on the compiler version that |
| 5069 |
was used to compile a module. The compiler checks this information |
| 5070 |
and automatically rebuilds a module that was built by an older version |
| 5071 |
of the compiler. This ensures that all components of a program are |
| 5072 |
rebuilt whenever a new version of the compiler is installed. (In the |
| 5073 |
past, the compiler did not consider itself to be a dependency of the |
| 5074 |
derived files, which occasionally led to confusing link-time errors |
| 5075 |
caused by mismatched object file information.) |
| 5076 |
|
| 5077 |
</ul> |
| 5078 |
|
| 5079 |
|
| 5080 |
|
| 5081 |
<h3>Changes for 3.0.5h (09/14/2002)</h3> |
| 5082 |
|
| 5083 |
<ul> |
| 5084 |
|
| 5085 |
<li>Some slight additional performance optimizations in the VM should |
| 5086 |
improve execution speed by another 10% or so (vs. release 3.0.5g). |
| 5087 |
|
| 5088 |
<li>Fixed a problem in the Dictionary class that caused spurious |
| 5089 |
run-time error when restoring games (particularly when restoring |
| 5090 |
after a RESTART operation had been previously performed). |
| 5091 |
|
| 5092 |
<li>Fixed a problem in the regular expression parser: the |
| 5093 |
counted-repeat operator ({n,m}) did not nest properly with closures. |
| 5094 |
|
| 5095 |
<li>Fixed a debugger problem that caused the debugger to fail to |
| 5096 |
take control (i.e., pause the game program and enter the debugger UI) |
| 5097 |
when a run-time error occurred under certain conditions when using |
| 5098 |
the "Step Out" or "Step Over" commands. |
| 5099 |
|
| 5100 |
<li class=last>Fixed a problem in the console-based text-only interpreters that |
| 5101 |
caused the [More] prompt to be displayed at the wrong place (at the |
| 5102 |
end of a line of text, rather than at the beginning) under certain |
| 5103 |
rare conditions. |
| 5104 |
|
| 5105 |
</ul> |
| 5106 |
|
| 5107 |
|
| 5108 |
|
| 5109 |
<h3>Changes for 3.0.5g (09/08/2002)</h3> |
| 5110 |
|
| 5111 |
<ul> |
| 5112 |
|
| 5113 |
<li>The <a href="sysman/dict.htm">Dictionary</a> intrinsic class has been |
| 5114 |
substantially altered. The central change is that the caller can now |
| 5115 |
specify a "comparator" object that defines how strings in the |
| 5116 |
dictionary are compared to input strings; this allows the game to |
| 5117 |
customize the rules for looking up dictionary words. Related to this, |
| 5118 |
all methods related to truncation length have been removed; instead, |
| 5119 |
truncation, if desired, is now handled through the comparator. |
| 5120 |
Finally, the methods that look up words in the dictionary (findWord |
| 5121 |
and isWordDefined) have changed slightly to provide additional |
| 5122 |
information from the comparator about how an input word matches a |
| 5123 |
dictionary word. |
| 5124 |
|
| 5125 |
<li>Added the <a href="sysman/strcomp.htm">StringComparator</a> intrinsic |
| 5126 |
class. This class works with the <a href="sysman/dict.htm">Dictionary</a> |
| 5127 |
intrinsic class to specify customized rules for matching input words |
| 5128 |
to dictionary words. StringComparator provides options that specify |
| 5129 |
whether or not upper- and lower-case letters are distinguished; |
| 5130 |
whether words can be truncated (abbreviated) on input, and to what |
| 5131 |
minimum length; and a set of equivalence mappings that allow |
| 5132 |
alternative spellings on input, such as using unaccented equivalents |
| 5133 |
of accented characters. |
| 5134 |
|
| 5135 |
<li class=last>The <a href="sysman/gramprod.htm">GrammarProd</a> intrinsic class method |
| 5136 |
parseTokens() now uses the supplied Dictionary to perform comparisons |
| 5137 |
to literal tokens. Each input token is compared to literal tokens in |
| 5138 |
the grammar rules using the Dictionary's current comparator. Literal |
| 5139 |
tokens in grammar rules thus are matched using the same rules as |
| 5140 |
dictionary words. The matchValues() results are stored in the |
| 5141 |
match tree objects in the new property tokenMatchList: this property |
| 5142 |
is set in each object in the match tree, and contains a list of |
| 5143 |
the matchValues() results corresponding to the token list elements. |
| 5144 |
|
| 5145 |
</ul> |
| 5146 |
|
| 5147 |
|
| 5148 |
<h3>Changes for 3.0.5f (09/02/2002)</h3> |
| 5149 |
|
| 5150 |
<ul> |
| 5151 |
|
| 5152 |
<li>Added the new method findReplace() to the <a |
| 5153 |
href="sysman/string.htm">String</a> intrinsic class. This new method is |
| 5154 |
similar to the <a href="sysman/tadsgen.htm">rexReplace()</a> |
| 5155 |
function, but is slightly more efficient for situations where the text |
| 5156 |
to be replaced is a simple constant string rather than a regular |
| 5157 |
expression pattern. It's also slightly simpler to use, since it's not |
| 5158 |
necessary to worry about any special regular expression interpretation |
| 5159 |
of the search string. |
| 5160 |
|
| 5161 |
<li class=last>Added the new intrinsic class <a |
| 5162 |
href="sysman/rexpat.htm">RexPattern</a>. This new class encapsulates a |
| 5163 |
"compiled" regular expression pattern, which can be used in place of a |
| 5164 |
pattern string in the regular expression functions. Compiling an |
| 5165 |
expression converts it from a string into an internal representation. |
| 5166 |
When a particular pattern is used repeatedly in many searches, it's |
| 5167 |
much more efficient to use a RexPattern object to conduct searches |
| 5168 |
with the pattern, because the regular expression functions have to |
| 5169 |
compile their search patterns internally anyway; by using a |
| 5170 |
RexPattern, you perform the compilation for a particular pattern only |
| 5171 |
once, in advance, rather than each time you use the pattern. |
| 5172 |
Compilation takes a non-trivial amount of time, so if a pattern is |
| 5173 |
used frequently, pre-compiling it to a RexPattern can make a |
| 5174 |
difference in execution performance. |
| 5175 |
|
| 5176 |
</ul> |
| 5177 |
|
| 5178 |
|
| 5179 |
<h3>Changes for 3.0.5e (08/25/2002)</h3> |
| 5180 |
|
| 5181 |
<ul> |
| 5182 |
|
| 5183 |
<li>This release has a number of VM, compiler, and intrinsic class |
| 5184 |
changes intended to make programs run faster. The compiler now |
| 5185 |
generates more optimized code (especially when compiling with no debug |
| 5186 |
information), and VM executes code faster. The changes should be |
| 5187 |
entirely transparent in terms of functionality, although a few new |
| 5188 |
VM instructions have been added, so code compiled with this new |
| 5189 |
version of the compiler will not run with older VM versions. |
| 5190 |
|
| 5191 |
<li>Added two new <a href="sysman/lookup.htm">LookupTable</a> methods: |
| 5192 |
keysToList(), which returns a list consisting of all of the keys |
| 5193 |
in the table; and valsToList(), which returns a list consisting of |
| 5194 |
all of the values in the table. In both cases, the lists are in |
| 5195 |
arbitrary order. |
| 5196 |
|
| 5197 |
<li>The compiler left out a final newline after the error/warning |
| 5198 |
count summary at the end of a compilation that generated error or |
| 5199 |
warning messages. This is now fixed. |
| 5200 |
|
| 5201 |
<li>Fixed a couple of dialog messages in Workbench for Windows that |
| 5202 |
referred to ".t3x" files (the old version of the ".t3" extension). |
| 5203 |
|
| 5204 |
<li>Fixed a problem in Workbench for Windows that caused an |
| 5205 |
unparseable compiler command line to be generated if an option |
| 5206 |
argument (such as an Include path) ended with a backslash. The |
| 5207 |
problem had to do with DOS's odd command-line quoting rules; the |
| 5208 |
trailing backslash was treated as "quoting" the quote mark at the end |
| 5209 |
of the option argument. This has been corrected. |
| 5210 |
|
| 5211 |
<li>The compiler's command line error diagnostics are now somewhat |
| 5212 |
improved, to help pinpoint the source of an error. In the past, the |
| 5213 |
compiler always simply showed its usage message if the command line had |
| 5214 |
a problem, which didn't help much in identifying which argument was |
| 5215 |
causing the problem. The compiler now shows the usage message only |
| 5216 |
when the command line is empty (or when the argument "-help" is given); |
| 5217 |
in case of error, the compiler now shows a message explaining the |
| 5218 |
specific problem, and shows the particular option causing the problem |
| 5219 |
if appropriate. |
| 5220 |
|
| 5221 |
<li class=last>In Workbench for Windows, the folder selector dialog was started |
| 5222 |
with an empty current folder, which made the entire dialog appear |
| 5223 |
empty, in some cases (such as when adding a directory to the "Include" |
| 5224 |
list in the Build Settings dialog). The dialog should now always |
| 5225 |
start with a valid initial directory. |
| 5226 |
|
| 5227 |
</ul> |
| 5228 |
|
| 5229 |
|
| 5230 |
<h3>Changes for 3.0.5d (08/04/2002)</h3> |
| 5231 |
|
| 5232 |
<ul> |
| 5233 |
|
| 5234 |
<li>Workbench for Windows now has a primitive but usable "profiling" |
| 5235 |
feature. Profiling is a technique in which the programmer collects |
| 5236 |
data on where the running program is spending its time. The purpose |
| 5237 |
is to identify any areas where the program spends a disproportionate |
| 5238 |
amount of time; this sometimes reveals obvious bottlenecks where the |
| 5239 |
code can be sped up with simple improvements, and in any case usually |
| 5240 |
reveals the areas where optimization efforts will yield the greatest |
| 5241 |
results. Workbench collects profiling data with function/method |
| 5242 |
granularity: each time the program enters or exits a function or |
| 5243 |
method, Workbench can track the time spent in that code. The user can |
| 5244 |
turn profiling on and off using the new "Profiler" menu; when |
| 5245 |
profiling is turned on, Workbench collects profiling data until the |
| 5246 |
profiler is turned off, at which point the system asks for a file to |
| 5247 |
which to write the collected data. Workbench writes the data as a |
| 5248 |
tab-delimited text file: the first column is the name of the function |
| 5249 |
or method; the second is the number of microseconds spent |
| 5250 |
<b>directly</b> in that code; the third is the number of microseconds |
| 5251 |
spent in functions or methods <b>called by</b> that code (which |
| 5252 |
excludes the time spent directly in the code itself); and the fourth |
| 5253 |
is the number of times the function or method was invoked. This |
| 5254 |
format can be easily loaded into an external analysis tool (such as a |
| 5255 |
spreadsheet application) for inspection. (The profiling facility is |
| 5256 |
designed mostly for use by library authors, so we probably won't |
| 5257 |
go to great lengths in the area of ease of use; and we don't expect |
| 5258 |
to build any integrated analysis tools, as a spreadsheet is more |
| 5259 |
than adequate to analyze the data.) |
| 5260 |
|
| 5261 |
<li>Fixed some problems in the DOS interpreter's display management |
| 5262 |
(these are generic character-mode interpreter fixes that will also |
| 5263 |
take care of the same problems on Unix and other character-mode |
| 5264 |
systems). The problems affected resizing the terminal window, |
| 5265 |
interaction with "More" prompts in some situations, and cursor |
| 5266 |
placement under certain conditions. In addition, the "review mode" |
| 5267 |
status bar is back (it was missing from the first versions with the |
| 5268 |
banner API); note, though, that the mode bar is now displayed at the |
| 5269 |
top of the main game window rather than taking over the status line, |
| 5270 |
which is necessary because of the possibility the banner API creates |
| 5271 |
of non-standard status line layouts. |
| 5272 |
|
| 5273 |
<li class=last>Fixed a problem in the VM that could conceivably have caused |
| 5274 |
crashes or other misbehavior under certain extremely improbable |
| 5275 |
conditions involving stack overflows. |
| 5276 |
|
| 5277 |
</ul> |
| 5278 |
|
| 5279 |
|
| 5280 |
|
| 5281 |
<h3>Changes for 3.0.5c (07/28/2002)</h3> |
| 5282 |
|
| 5283 |
<ul> |
| 5284 |
|
| 5285 |
<li>The banner creation function bannerCreate() has a slightly modified |
| 5286 |
interface. The new interface allows the initial size of the banner to |
| 5287 |
be set in terms of the natural sizing units of the window; in addition, |
| 5288 |
percentage-based sizing is still possible as well. |
| 5289 |
|
| 5290 |
<li>Percentage-based banner sizing now behaves slightly differently |
| 5291 |
than it used to. In the past, the percentage size was based on the size |
| 5292 |
of the complete application window. The percentage size is now based |
| 5293 |
instead on the "remaining space" at the point at which a banner is |
| 5294 |
laid out during the screen layout process. |
| 5295 |
|
| 5296 |
<li class=last>The new banner function bannerSetSize() complements |
| 5297 |
bannerSizeToContents() by adding the ability to set a banner's |
| 5298 |
size in terms of the natural sizing units of the window or a new |
| 5299 |
percentage-based size. |
| 5300 |
|
| 5301 |
</ul> |
| 5302 |
|
| 5303 |
|
| 5304 |
|
| 5305 |
<h3>Changes for 3.0.5b (07/20/2002)</h3> |
| 5306 |
|
| 5307 |
<ul> |
| 5308 |
|
| 5309 |
<li class=last>Fixed a bug in the interpreter that caused sporadic crashes in |
| 5310 |
situations involving adding lots of new properties to an object (of |
| 5311 |
class TadsObject). |
| 5312 |
|
| 5313 |
</ul> |
| 5314 |
|
| 5315 |
|
| 5316 |
<h3>Changes for 3.0.5a (07/14/2002)</h3> |
| 5317 |
|
| 5318 |
<ul> |
| 5319 |
|
| 5320 |
<li>A new set of functions, collectively called the |
| 5321 |
<a href="sysman/banners.htm">banner API</a>, provides more direct programmatic |
| 5322 |
control over the appearance of the user interface than was available |
| 5323 |
in past versions of TADS. The new API allows the program to divide |
| 5324 |
the display into multiple "banners," which are non-overlapping windows, |
| 5325 |
each with its own independent output stream. The banner API provides |
| 5326 |
functionality based on the HTML TADS <BANNER> tag, but offers |
| 5327 |
more power, and is also supported on many text-only interpreters. |
| 5328 |
|
| 5329 |
<li>Any time a nested object is defined, the compiler now automatically |
| 5330 |
defines the property <tt>lexicalParent</tt> in the nested object, setting |
| 5331 |
the property to a reference to the lexically enclosing object. |
| 5332 |
|
| 5333 |
<li>The main text window's output stream is now <b>always</b> in HTML mode. |
| 5334 |
The "\{" and "\}" sequences have likewise been removed, since these |
| 5335 |
are no longer useful now that HTML mode cannot be switched on and off. |
| 5336 |
|
| 5337 |
<li>The "\H+" and "\H-" output control sequences have been removed. |
| 5338 |
These are no longer useful now that HTML mode switching has been removed. |
| 5339 |
|
| 5340 |
<li>The "\(" and "\)" output control sequences have been removed. |
| 5341 |
The HTML markups <B> and </B> should be used instead. |
| 5342 |
The "\(" and "\)" sequences are now redundant with the HTML <B> |
| 5343 |
markup, since text output streams are now always in HTML mode. |
| 5344 |
|
| 5345 |
<li>A new system information code, SysInfoInterpClass, retrieves |
| 5346 |
information on the broad "class" of the interpreter. This returns |
| 5347 |
one of the following: |
| 5348 |
|
| 5349 |
<ul> |
| 5350 |
<li>SysInfoIClassText: a text-only character-mode interpreter, such as |
| 5351 |
MS-DOS TADS or Unix TADS. This type of interpreter uses a single |
| 5352 |
fixed-pitch font to show all text, cannot show any graphics, and |
| 5353 |
uses the text-only HTML subset. |
| 5354 |
<li>SysInfoIClassTextGUI: a text-only interpreter running on a graphical |
| 5355 |
platform, such as MacTADS or WinTADS. This type of interpreter |
| 5356 |
might use proportionally-spaced fonts, and might use multiple fonts. |
| 5357 |
These interpreters cannot show graphics using HTML, but they might |
| 5358 |
use some graphics of their own for things like window borders. |
| 5359 |
This type of interpreter recognizes the text-only HTML subset. |
| 5360 |
Note that this code isn't indicative of the type of OS, but rather |
| 5361 |
of the type of interpreter: MS-DOS TADS <b>always</b> returns |
| 5362 |
SysInfoIClassText, even when it's running in a DOS box under |
| 5363 |
Windows, because it still acts like a character-mode interpreter |
| 5364 |
even when running on a Windows machine. |
| 5365 |
<li>SysInfoIClassHTML: a full HTML interpreter, such as HTML TADS on |
| 5366 |
Windows, or HyperTADS on Macintosh. |
| 5367 |
</ul> |
| 5368 |
|
| 5369 |
<li>The SysInfoHtml and SysInfoHtmlMode system information codes have |
| 5370 |
been eliminated. The former is superseded by SysInfoInterpClass, and |
| 5371 |
the latter has been rendered obsolete by the elimination of HTML mode |
| 5372 |
switching. |
| 5373 |
|
| 5374 |
<li>The TADS 3 character-mode interpreters now support the <TAB> |
| 5375 |
tag, if the underlying OS code allows. This tag is supported on all |
| 5376 |
full HTML interpreters, plus most character-mode text-only platforms. |
| 5377 |
The GUI text-only interpreters do not support this currently. The |
| 5378 |
full complement of <TAB> features is supported; see the HTML TADS |
| 5379 |
documentation (specifically, the TADS-specific markup extensions) for |
| 5380 |
details. |
| 5381 |
|
| 5382 |
<li>The compiler and VM support "transient" objects, which are objects |
| 5383 |
that do not participate in any of the VM's built-in persistence |
| 5384 |
mechanisms (save, restore, undo, restart). A transient object is |
| 5385 |
not saved to a saved state file, and isn't affected by restore, undo, |
| 5386 |
or restart operations. This is described more fully in the |
| 5387 |
<a href="sysman/objdef.htm">Object Definitions</a> section of |
| 5388 |
the documentation. |
| 5389 |
|
| 5390 |
<li>The <a href="sysman/tadsgen.htm">saveGame</a> function works |
| 5391 |
differently than it used to. The function no longer saves the |
| 5392 |
execution context, so it no longer has the "setjmp" behavior. |
| 5393 |
|
| 5394 |
<li>The <a href="sysman/tadsgen.htm">restoreGame</a> function |
| 5395 |
works differently as well. Because saveGame no longer saves the |
| 5396 |
execution context, restoreGame no longer restores it, so the function |
| 5397 |
simply returns on successful completion - it doesn't have the |
| 5398 |
"longjmp" behavior any more. This new design is much more flexible, |
| 5399 |
because it allows arbitrary session information to be retained |
| 5400 |
across the Restore operation, via local variables on the stack as |
| 5401 |
well as with transient objects, and gives the program complete |
| 5402 |
control over execution flow throughout the operation. |
| 5403 |
|
| 5404 |
<li>The <a href="sysman/tadsgen.htm">restartGame</a> function |
| 5405 |
also has a new design. The function no longer requires a function |
| 5406 |
to jump to, but simply resets object state and returns. As with the |
| 5407 |
restoreGame changes, this allows the program complete control over |
| 5408 |
execution flow and allows any amount of session information to |
| 5409 |
be retained across the Restart operation. |
| 5410 |
|
| 5411 |
<li>All instances of the <a href="sysman/file.htm">File</a> intrinsic |
| 5412 |
class are now transient. The static creation methods of the File |
| 5413 |
class always return transient objects. |
| 5414 |
|
| 5415 |
<li>It is now possible to open "resources" as though they were files, |
| 5416 |
and read their data using the <a href="sysman/file.htm">File intrinsic |
| 5417 |
class</a>. Two new static construction methods make this possible: |
| 5418 |
openTextResource() and openRawResource(). |
| 5419 |
|
| 5420 |
<li>The option flags for the String.htmlify() method have been renamed, |
| 5421 |
to make the names of the flags more descriptive of their functions. |
| 5422 |
The flags formerly were of the form HtmlifyKeepXxx, but now use names |
| 5423 |
of the form HtmlifyTranslateXxx. The change of terms to "translate" |
| 5424 |
is a better match for what the flags actually mean, since the flags |
| 5425 |
specify that certain characters are to be translated into HTML markup |
| 5426 |
equivalents. |
| 5427 |
|
| 5428 |
<li>In Workbench for Windows, when the status line is displayed, the |
| 5429 |
messages from the compiler showing the build progress are not displayed |
| 5430 |
to the debug log window, but rather to the status line. This makes it |
| 5431 |
much easier to read the results in the log window, and especially makes |
| 5432 |
it easier to see the error messages, since the error messages aren't |
| 5433 |
mixed in with lots of build progress messages. When the status line |
| 5434 |
is hidden, build progress messages are still shown in the log window |
| 5435 |
so that the compiler's progress can be seen. |
| 5436 |
|
| 5437 |
<li>The internal character encoding that the T3 software was using |
| 5438 |
in past versions was not in conformance with the T3 specification, which |
| 5439 |
calls for the standard UTF-8 encoding. The software was using an older |
| 5440 |
encoding that had been obsoleted in the spec but was never changed in |
| 5441 |
the software. This has been corrected; note that this change requires |
| 5442 |
recompiling any existing games. |
| 5443 |
|
| 5444 |
<li>Due to a bug, Workbench for Windows did not properly store directory |
| 5445 |
paths (such as for the Include path list) in the project file when the |
| 5446 |
paths included a colon (":") character. This has been fixed. |
| 5447 |
|
| 5448 |
<li>A bug in Workbench for Windows caused the Window menu to display |
| 5449 |
incorrect entries for Windows 95 and NT 4 (actually, this is more due |
| 5450 |
to a bug in Windows 95 and NT 4, but Workbench didn't work around the |
| 5451 |
bug, so in a sense it was a Workbench bug). This has been corrected. |
| 5452 |
|
| 5453 |
<li class=last>A compiler bug caused the compiler to crash (with an access |
| 5454 |
violation or equivalent) when given a source file whose very first |
| 5455 |
object definition started with a template containing a double-quoted |
| 5456 |
string with an embedded expression. This problem is now fixed. |
| 5457 |
|
| 5458 |
</ul> |
| 5459 |
|
| 5460 |
|
| 5461 |
<h3>Changes for version 3.0.4 - 06/01/2002</h3> |
| 5462 |
|
| 5463 |
<ul> |
| 5464 |
|
| 5465 |
<li>Fixed a problem in the Vector intrinsic class that caused interpreter |
| 5466 |
crashes under certain circumstances. (The exact conditions were not |
| 5467 |
entirely predictable, because the problem had to do with an interaction |
| 5468 |
between the Vector class, the garbage collector, and the undo mechanism, |
| 5469 |
and only occurred when garbage collection was triggered after certain |
| 5470 |
operations in the Vector class.) |
| 5471 |
|
| 5472 |
<li>Added a status line to Workbench for Windows. The status line is |
| 5473 |
optional; it can be displayed or hidden, as desired, using the "View" menu. |
| 5474 |
When displayed, the status line shows whether or not the program being |
| 5475 |
debugged is running, and shows the line and column number of the current |
| 5476 |
cursor position when a source file window is active. |
| 5477 |
|
| 5478 |
<li class=last>Fixed a problem in Workbench that prevented parts of the window |
| 5479 |
layout from being saved in the project configuration file when the |
| 5480 |
main Workbench application window was closed while the program being |
| 5481 |
debugged was still running. |
| 5482 |
|
| 5483 |
</ul> |
| 5484 |
|
| 5485 |
|
| 5486 |
|
| 5487 |
<h3>Changes for 05/19/2002</h3> |
| 5488 |
|
| 5489 |
<ul> |
| 5490 |
|
| 5491 |
<li>The DOS text-mode interpreter now supports setting text colors. |
| 5492 |
Text colors can be set through HTML, as follows: |
| 5493 |
|
| 5494 |
<ul> |
| 5495 |
<li>The <FONT COLOR=xxx BGCOLOR=yyy> tag can be used to set the |
| 5496 |
and background colors of the text. The basic set of HTML colors is |
| 5497 |
recognized, although |
| 5498 |
the effective set of available colors is limited to the eight ANSI |
| 5499 |
colors that DOS character mode can display: white, black, red, green, |
| 5500 |
blue, yellow, cyan, and magenta. Hex RGB values (for example, |
| 5501 |
<FONT COLOR='#C080E0'> are accepted, but these are simply |
| 5502 |
mapped to the nearest available color from the ANSI set. |
| 5503 |
Note that if a FONT tag specifies both COLOR and BGCOLOR, the text |
| 5504 |
will be displayed exactly as specified; if the FONT tag specifies |
| 5505 |
only COLOR, then the background color will be inherited from the |
| 5506 |
enclosing text, and ultimately from the <BODY> color if no |
| 5507 |
enclosing text has a specific background color. |
| 5508 |
|
| 5509 |
<li>The <BODY> tag can be used to set the foreground and background |
| 5510 |
color of the window. The TEXT attribute sets the foreground text color, |
| 5511 |
and the BGCOLOR attribute sets the background color of the window. |
| 5512 |
The background color affects the entire window, just as in the |
| 5513 |
HTML interpreters, so the entire window will be redisplayed in its |
| 5514 |
new color whenever a <BODY BGCOLOR=xxx> tag is displayed. |
| 5515 |
|
| 5516 |
<li>The parameterized color names (TEXT, BGCOLOR, STATUSTEXT, STATUSBG) |
| 5517 |
are accepted and map to the current settings of those colors, as set |
| 5518 |
by the TRCOLOR program. |
| 5519 |
</ul> |
| 5520 |
|
| 5521 |
<li>The new system information code SysInfoTextColors can be used to |
| 5522 |
determine the level of color support available on the platform. The |
| 5523 |
return value is a code indicating the level of support: |
| 5524 |
|
| 5525 |
<ul> |
| 5526 |
<li>SysInfoTxcNone - no color support |
| 5527 |
<li>SysInfoTxcParam - parameterized color names only |
| 5528 |
<li>SysInfoTxcAnsiFg - The eight ANSI colors are available for text, but |
| 5529 |
there is no capability to set the background color |
| 5530 |
<li>SysInfoTxcAnsiFgBg - the ANSI colors are available for text and |
| 5531 |
background colors (this is the code the DOS interpreter returns) |
| 5532 |
<li>SysInfoTxcRGB - full RGB text color support is available (this is the |
| 5533 |
code the Windows HTML interpreter returns) |
| 5534 |
</ul> |
| 5535 |
|
| 5536 |
<li class=last>The new system information code SysInfoTextHilite can be used to |
| 5537 |
determine whether or not text highlighting is available. This returns |
| 5538 |
true if a distinctive appearance for <B> text is available, |
| 5539 |
nil if not. The HTML interpreters return true for this; the text-only |
| 5540 |
interpreters generally return true, unless running in "plain" ASCII |
| 5541 |
mode or with a terminal or display device that cannot render anything |
| 5542 |
special for highlighted text. |
| 5543 |
|
| 5544 |
</ul> |
| 5545 |
|
| 5546 |
|
| 5547 |
|
| 5548 |
<h3>Changes for 05/05/2002</h3> |
| 5549 |
|
| 5550 |
<ul> |
| 5551 |
|
| 5552 |
<li>Fixed a problem in Workbench for Windows with libraries (.tl |
| 5553 |
files) found via the library search path. In some cases, the files |
| 5554 |
within a library could not be opened; in addition, the library itself |
| 5555 |
was not always properly scanned on opening the project, so no files |
| 5556 |
within the library were visible in the Project window. Libraries |
| 5557 |
found via the search path should work properly now. |
| 5558 |
|
| 5559 |
<li>Workbench for Windows now uses small (8x8-pixel) icons in the left |
| 5560 |
margin of debugger source windows when the selected source window font |
| 5561 |
is smaller than the standard (16x16-pixel) icons. (These are the icons |
| 5562 |
that show the location of the current line, breakpoints, and so on |
| 5563 |
during a debugging session.) This allows more lines to be displayed |
| 5564 |
vertically in a source window when a small font is selected. |
| 5565 |
|
| 5566 |
<li>When quitting out of Workbench, if a build is still running, the |
| 5567 |
Workbench displays a dialog indicating that Workbench is waiting for |
| 5568 |
the build to complete. In the past, there was no way to force |
| 5569 |
Workbench to exit if the build process had become stuck. Now, the |
| 5570 |
"waiting for build" dialog offers an "Abort" button; clicking this |
| 5571 |
button will forcibly terminate the build, allowing Workbench to |
| 5572 |
terminate immediately. This button is useful when the build process |
| 5573 |
becomes stuck (which ideally should never happen, but has happened |
| 5574 |
at times due to compiler bugs). The build process should not normally |
| 5575 |
be aborted forcibly unless the build appears stuck, because forcibly |
| 5576 |
terminating a process on Windows can occasionally cause Windows to |
| 5577 |
become unstable. |
| 5578 |
|
| 5579 |
<li>Fixed a compiler bug that made it possible for the linking step |
| 5580 |
to get stuck in an infinite loop if the data associated with a particular |
| 5581 |
"grammar" production became too large. This should no longer occur. |
| 5582 |
|
| 5583 |
<li>Fixed a debugger bug that caused sporadic crashes when running |
| 5584 |
games in Workbench. |
| 5585 |
|
| 5586 |
<li class=last>Added new systemInfo() codes for MNG display: |
| 5587 |
<ul> |
| 5588 |
<li>SysInfoMng - can the system display MNG images? |
| 5589 |
<li>SysInfoMngTrans - can the system display MNG's with transparency? |
| 5590 |
<li>SysInfoMngAlpha - can the system display MNG's with alpha channels |
| 5591 |
(i.e., partial transparency)? |
| 5592 |
</ul> |
| 5593 |
|
| 5594 |
</ul> |
| 5595 |
|
| 5596 |
|
| 5597 |
<h3>Changes for 04/28/2002</h3> |
| 5598 |
|
| 5599 |
<ul> |
| 5600 |
|
| 5601 |
<li>Renamed numerous macros in the system and adv3 header files to |
| 5602 |
achieve more consistency in the naming scheme. Here's a table of |
| 5603 |
the changes. (Sorry this isn't a Perl script or something.) |
| 5604 |
|
| 5605 |
<p><center><table> |
| 5606 |
<tr><th align=left>Old Name<th align=left>New Name |
| 5607 |
<tr><td>BIGNUM_SIGN<td>BignumSign |
| 5608 |
<tr><td>BIGNUM_EXP<td>BignumExp |
| 5609 |
<tr><td>BIGNUM_EXP_SIGN<td>BignumExpSign |
| 5610 |
<tr><td>BIGNUM_LEADING_ZERO<td>BignumLeadingZero |
| 5611 |
<tr><td>BIGNUM_POINT<td>BignumPoint |
| 5612 |
<tr><td>BIGNUM_COMMAS<td>BignumCommas |
| 5613 |
<tr><td>BIGNUM_POS_SPACE<td>BignumPosSpace |
| 5614 |
<tr><td>BIGNUM_EUROSTYLE<td>BignumEuroStyle |
| 5615 |
<tr><td>TYPE_NIL<td>TypeNil |
| 5616 |
<tr><td>TYPE_TRUE<td>TypeTrue |
| 5617 |
<tr><td>TYPE_OBJECT<td>TypeObject |
| 5618 |
<tr><td>TYPE_PROP<td>TypeProp |
| 5619 |
<tr><td>TYPE_INT<td>TypeInt |
| 5620 |
<tr><td>TYPE_SSTRING<td>TypeSString |
| 5621 |
<tr><td>TYPE_DSTRING<td>TypeDString |
| 5622 |
<tr><td>TYPE_LIST<td>TypeList |
| 5623 |
<tr><td>TYPE_CODE<td>TypeCode |
| 5624 |
<tr><td>TYPE_FUNCPTR<td>TypeFuncPtr |
| 5625 |
<tr><td>TYPE_NATIVE_CODE<td>TypeNativeCode |
| 5626 |
<tr><td>TYPE_ENUM<td>TypeEnum |
| 5627 |
<tr><td>PROPDEF_ANY<td>PropDefAny |
| 5628 |
<tr><td>PROPDEF_DIRECTLY<td>PropDefDirectly |
| 5629 |
<tr><td>PROPDEF_INHERITS<td>PropDefInherits |
| 5630 |
<tr><td>PROPDEF_GET_CLASS<td>PropDefGetClass |
| 5631 |
<tr><td>STR_HTML_KEEP_SPACES<td>HtmlifyKeepSpaces |
| 5632 |
<tr><td>STR_HTML_KEEP_NEWLINES<td>HtmlifyKeepNewlines |
| 5633 |
<tr><td>STR_HTML_KEEP_TABS<td>HtmlifyKeepTabs |
| 5634 |
<tr><td>STR_HTML_KEEP_WHITESPACE<td>HtmlifyKeepWhitespace |
| 5635 |
<tr><td>T3DBG_CHECK<td>T3DebugCheck |
| 5636 |
<tr><td>T3DBG_BREAK<td>T3DebugBreak |
| 5637 |
<tr><td>OBJ_INSTANCES<td>ObjInstances |
| 5638 |
<tr><td>OBJ_CLASSES<td>ObjClasses |
| 5639 |
<tr><td>OBJ_ALL<td>ObjAll |
| 5640 |
<tr><td>REPLACE_ONCE<td>ReplaceOnce |
| 5641 |
<tr><td>REPLACE_ALL<td>ReplaceAll |
| 5642 |
<tr><td>GETTIME_DATE_AND_TIME<td>GetTimeDateAndTime |
| 5643 |
<tr><td>GETTIME_TICKS<td>GetTimeTicks |
| 5644 |
<tr><td>INEVT_KEY<td>InEvtKey |
| 5645 |
<tr><td>INEVT_TIMEOUT<td>InEvtTimeout |
| 5646 |
<tr><td>INEVT_HREF<td>InEvtHref |
| 5647 |
<tr><td>INEVT_NOTIMEOUT<td>InEvtNotimeout |
| 5648 |
<tr><td>INEVT_EOF<td>InEvtEof |
| 5649 |
<tr><td>INEVT_LINE<td>InEvtLine |
| 5650 |
<tr><td>INEVT_END_QUIET_SCRIPT<td>InEvtEndQuietScript |
| 5651 |
<tr><td>INDLG_OK<td>InDlgOk |
| 5652 |
<tr><td>INDLG_OKCANCEL<td>InDlgOkcancel |
| 5653 |
<tr><td>INDLG_YESNO<td>InDlgYesNo |
| 5654 |
<tr><td>INDLG_YESNOCANCEL<td>InDlgYesNoCancel |
| 5655 |
<tr><td>INDLG_ICON_NONE<td>InDlgIconNone |
| 5656 |
<tr><td>INDLG_ICON_WARNING<td>InDlgIconWarning |
| 5657 |
<tr><td>INDLG_ICON_INFO<td>InDlgIconInfo |
| 5658 |
<tr><td>INDLG_ICON_QUESTION<td>InDlgIconQuestion |
| 5659 |
<tr><td>INDLG_ICON_ERROR<td>InDlgIconError |
| 5660 |
<tr><td>INDLG_LBL_OK<td>InDlgLblOk |
| 5661 |
<tr><td>INDLG_LBL_CANCEL<td>InDlgLblCancel |
| 5662 |
<tr><td>INDLG_LBL_YES<td>InDlgLblYes |
| 5663 |
<tr><td>INDLG_LBL_NO<td>InDlgLblNo |
| 5664 |
<tr><td>INFILE_OPEN<td>InFileOpen |
| 5665 |
<tr><td>INFILE_SAVE<td>InFileSave |
| 5666 |
<tr><td>INFILE_SUCCESS<td>InFileSuccess |
| 5667 |
<tr><td>INFILE_FAILURE<td>InFileFailure |
| 5668 |
<tr><td>INFILE_CANCEL<td>InFileCancel |
| 5669 |
<tr><td>FILETYPE_LOG<td>FileTypeLog |
| 5670 |
<tr><td>FILETYPE_DATA<td>FileTypeData |
| 5671 |
<tr><td>FILETYPE_CMD<td>FileTypeCmd |
| 5672 |
<tr><td>FILETYPE_TEXT<td>FileTypeText |
| 5673 |
<tr><td>FILETYPE_BIN<td>FileTypeBin |
| 5674 |
<tr><td>FILETYPE_UNKNOWN<td>FileTypeUnknown |
| 5675 |
<tr><td>FILETYPE_T3IMAGE<td>FileTypeT3Image |
| 5676 |
<tr><td>FILETYPE_T3SAVE<td>FileTypeT3Save |
| 5677 |
<tr><td>SYSINFO_VERSION<td>SysInfoVersion |
| 5678 |
<tr><td>SYSINFO_OS_NAME<td>SysInfoOsName |
| 5679 |
<tr><td>SYSINFO_HTML<td>SysInfoHtml |
| 5680 |
<tr><td>SYSINFO_JPEG<td>SysInfoJpeg |
| 5681 |
<tr><td>SYSINFO_PNG<td>SysInfoPng |
| 5682 |
<tr><td>SYSINFO_WAV<td>SysInfoWav |
| 5683 |
<tr><td>SYSINFO_MIDI<td>SysInfoMidi |
| 5684 |
<tr><td>SYSINFO_WAV_MIDI_OVL<td>SysInfoWavMidiOvl |
| 5685 |
<tr><td>SYSINFO_WAV_OVL<td>SysInfoWavOvl |
| 5686 |
<tr><td>SYSINFO_PREF_IMAGES<td>SysInfoPrefImages |
| 5687 |
<tr><td>SYSINFO_PREF_SOUNDS<td>SysInfoPrefSounds |
| 5688 |
<tr><td>SYSINFO_PREF_MUSIC<td>SysInfoPrefMusic |
| 5689 |
<tr><td>SYSINFO_PREF_LINKS<td>SysInfoPrefLinks |
| 5690 |
<tr><td>SYSINFO_MPEG<td>SysInfoMpeg |
| 5691 |
<tr><td>SYSINFO_MPEG1<td>SysInfoMpeg1 |
| 5692 |
<tr><td>SYSINFO_MPEG2<td>SysInfoMpeg2 |
| 5693 |
<tr><td>SYSINFO_MPEG3<td>SysInfoMpeg3 |
| 5694 |
<tr><td>SYSINFO_HTML_MODE<td>SysInfoHtmlMode |
| 5695 |
<tr><td>SYSINFO_LINKS_HTTP<td>SysInfoLinksHttp |
| 5696 |
<tr><td>SYSINFO_LINKS_FTP<td>SysInfoLinksFtp |
| 5697 |
<tr><td>SYSINFO_LINKS_NEWS<td>SysInfoLinksNews |
| 5698 |
<tr><td>SYSINFO_LINKS_MAILTO<td>SysInfoLinksMailto |
| 5699 |
<tr><td>SYSINFO_LINKS_TELNET<td>SysInfoLinksTelnet |
| 5700 |
<tr><td>SYSINFO_PNG_TRANS<td>SysInfoPngTrans |
| 5701 |
<tr><td>SYSINFO_PNG_ALPHA<td>SysInfoPngAlpha |
| 5702 |
<tr><td>STATMODE_NORMAL<td>StatModeNormal |
| 5703 |
<tr><td>STATMODE_STATUS<td>StatModeStatus |
| 5704 |
<tr><td>SCRFILE_QUIET<td>ScriptFileQuiet |
| 5705 |
<tr><td>SCRFILE_NONSTOP<td>ScriptFileNonstop |
| 5706 |
<tr><td>CHARSET_DISPLAY<td>CharsetDisplay |
| 5707 |
<tr><td>CHARSET_FILE<td>CharsetFile |
| 5708 |
<tr><td>firstPerson<td>FirstPerson |
| 5709 |
<tr><td>secondPerson<td>SecondPerson |
| 5710 |
<tr><td>thirdPerson<td>ThirdPerson |
| 5711 |
<tr><td>spellIntTeenHundreds<td>SpellIntTeenHundreds |
| 5712 |
<tr><td>spellIntAndTens<td>SpellIntAndTens |
| 5713 |
<tr><td>spellIntCommas<td>SpellIntCommas |
| 5714 |
<tr><td>Logical<td>logical |
| 5715 |
<tr><td>LogicalRank<td>logicalRank |
| 5716 |
<tr><td>LogicalRankOrd<td>logicalRankOrd |
| 5717 |
<tr><td>Dangerous<td>dangerous |
| 5718 |
<tr><td>NonObvious<td>nonObvious |
| 5719 |
<tr><td>IllogicalNow<td>illogicalNow |
| 5720 |
<tr><td>Illogical<td>illogical |
| 5721 |
<tr><td>Inaccessible<td>inaccessible |
| 5722 |
<tr><td>DefaultReport<td>defaultReport |
| 5723 |
<tr><td>MainReport<td>mainReport |
| 5724 |
<tr><td>ReportBefore<td>reportBefore |
| 5725 |
<tr><td>ReportAfter<td>reportAfter |
| 5726 |
<tr><td>ReportFailure<td>reportFailure |
| 5727 |
<tr><td>IsNonDefaultReport<td>gIsNonDefaultReport |
| 5728 |
<tr><td>SingleDobj<td>singleDobj |
| 5729 |
<tr><td>SingleIobj<td>singleIobj |
| 5730 |
<tr><td>DobjList<td>dobjList |
| 5731 |
<tr><td>IobjList<td>iobjList |
| 5732 |
<tr><td>NumberPhrase<td>singleNumber |
| 5733 |
<tr><td>TopicPhrase<td>singleTopic |
| 5734 |
<tr><td>LiteralPhrase<td>singleLiteral |
| 5735 |
<tr><td>DirPhrase<td>singleDir |
| 5736 |
|
| 5737 |
</table> |
| 5738 |
</center> |
| 5739 |
|
| 5740 |
<li>Added Phil Lewis's new Adv3 Reference Help to Workbench for |
| 5741 |
Windows. This new Windows Help file is a reference to the classes |
| 5742 |
in the adv3 library; Phil created it for his own use but has |
| 5743 |
graciously offered it for inclusion in the Author's Kit distribution. |
| 5744 |
Phil says the reference isn't complete, but it has a wealth of |
| 5745 |
information all the same. The Adv3 Help can be reached from the |
| 5746 |
"TADS 3 Library" item on the Workbench "Help" menu. |
| 5747 |
|
| 5748 |
<li>The compiler can now search for source files using a |
| 5749 |
user-specified list of directories. This allows makefiles (.t3m |
| 5750 |
files) to specify source files using only relative filename paths, |
| 5751 |
eliminating any dependency in a makefile on the local system's |
| 5752 |
directory structure and thus allowing the project to be easily used on |
| 5753 |
other systems. The compiler searches for its files by looking in the |
| 5754 |
following locations, in order: |
| 5755 |
|
| 5756 |
<ul> |
| 5757 |
<li>The current working directory (for Workbench users, this is the |
| 5758 |
directory containing the .t3m file for the project). |
| 5759 |
|
| 5760 |
<li>The directories specified with "-Fs" compiler options, in the |
| 5761 |
order of the options. |
| 5762 |
|
| 5763 |
<li>The directories specified with the new "user library" mechanism. |
| 5764 |
|
| 5765 |
<li>The "system library" directory. This is the special directory |
| 5766 |
containing the compiler's own libraries. This directory varies |
| 5767 |
by system, but it is normally set up automatically when TADS is |
| 5768 |
installed and requires no user action to configure. |
| 5769 |
</ul> |
| 5770 |
|
| 5771 |
The "user library" list is specified using a system-dependent |
| 5772 |
mechanism: |
| 5773 |
|
| 5774 |
<ul> |
| 5775 |
<li>For the DOS/Windows command-line compiler (i.e., run from a |
| 5776 |
command prompt), set the environment variable TADSLIB |
| 5777 |
to a list of directories, separated by semicolons (";"). |
| 5778 |
|
| 5779 |
<li>For Workbench for Windows, enter the list of directories in |
| 5780 |
the "Libraries" page of the Workbench preferences dialog, |
| 5781 |
reachable from the "Options" item on the "View" menu. |
| 5782 |
|
| 5783 |
<li>The mechanisms for other systems are yet to be determined, |
| 5784 |
but in all likelihood Unix will use the same TADSLIB |
| 5785 |
environment variable as the DOS version. |
| 5786 |
</ul> |
| 5787 |
|
| 5788 |
<li>Workbench for Windows has a new option to automatically load |
| 5789 |
the most recent project when Workbench is started. To set the |
| 5790 |
start-up mode, use the "Start-Up" page of the Workbench preferences |
| 5791 |
dialog, reachable from the "Options" item on the "View" menu. |
| 5792 |
|
| 5793 |
<li>Added the new systemInfo() code SysInfoOgg, which senses whether |
| 5794 |
or not the interpreter supports Ogg Vorbis audio playback. |
| 5795 |
|
| 5796 |
<li>Changed <tt>inputEvent()</tt> so that it accepts a nil timeout |
| 5797 |
argument value, for consistency with <tt>inputLine()</tt>. A nil |
| 5798 |
value for the timeout is equivalent to omitting the timeout argument |
| 5799 |
entirely: it indicates that the input should be allowed to proceed |
| 5800 |
indefinitely. |
| 5801 |
|
| 5802 |
<li>The compiler now stores preprocessor symbol (macro) definitions |
| 5803 |
with the debugger records of the compiled program, when compiling |
| 5804 |
for source-level debugging (i.e., using the "-d" compiler command-line |
| 5805 |
option). The debugger uses the preprocessor symbols when parsing |
| 5806 |
expressions during the debugging session, so it is now possible |
| 5807 |
to interactively evaluate expressions involving macros. Note that |
| 5808 |
the compiler keeps debugging records for a macro only if the macro |
| 5809 |
(1) is never undefined (using #undef) or redefined with a different |
| 5810 |
expansion within a given module, and (2) has the exact same expansion |
| 5811 |
in every module in which it is defined; these restrictions mean that |
| 5812 |
only macros with consistent "global" meanings across the entire |
| 5813 |
program are visible in the debugger. |
| 5814 |
|
| 5815 |
<li>Fixed a problem in Workbench for Windows that caused an incorrect |
| 5816 |
name to be stored for the game's initial source file when creating a |
| 5817 |
new project. |
| 5818 |
|
| 5819 |
<li>Fixed a compiler problem that caused the compiler to crash when |
| 5820 |
confronted with a constant index expression where the indexed value |
| 5821 |
was not a list (e.g., <tt>1[1]</tt>). |
| 5822 |
|
| 5823 |
<li>Fixed a problem in the Windows HTML interpreter that prevented |
| 5824 |
interrupted command lines from continuing correctly. When a command |
| 5825 |
line input was interrupted by a timeout, the command line that was |
| 5826 |
under construction when the timeout occurred was not properly restored |
| 5827 |
for further editing. This has been corrected. |
| 5828 |
|
| 5829 |
<li>Fixed a problem in the VM that caused the VM to crash under rare |
| 5830 |
circumstances. The problem was particularly likely to occur when |
| 5831 |
stepping through large amounts of code with the debugger. |
| 5832 |
|
| 5833 |
<li>Fixed a problem in the character map compiler (mkchrtab) that |
| 5834 |
generated corrupted character map files when the source file had |
| 5835 |
duplicated display mapping entries. |
| 5836 |
|
| 5837 |
<li>The distributions (including the installer kits and the source |
| 5838 |
code distribution) now include a full set of character mapping files |
| 5839 |
that should cover most users on most platforms. For a listing of |
| 5840 |
the included codings, see charmap/README.txt. (The full set adds |
| 5841 |
only about 25k to the compressed distribution files, which seems a |
| 5842 |
small cost for the simplicity of having an essentially universal set |
| 5843 |
of mappings available with the default install.) |
| 5844 |
|
| 5845 |
<li>The Windows Author's Kit installer now associates .t3m files with |
| 5846 |
Workbench, so that double-clicking on a .t3m file from Windows |
| 5847 |
Explorer will open the file in Workbench. (The 4/7/2002 version still |
| 5848 |
set the association for .t3c files instead, despite Workbench's switch |
| 5849 |
to .t3c files for storing project configuration information.) |
| 5850 |
|
| 5851 |
<li class=last>Fixed a problem that caused the compiler to display the incorrect |
| 5852 |
text for invalid tokens in certain error messages related to 'grammar' |
| 5853 |
statement syntax. |
| 5854 |
|
| 5855 |
</ul> |
| 5856 |
|
| 5857 |
|
| 5858 |
<h3>Changes for 04/07/2002</h3> |
| 5859 |
|
| 5860 |
<ul> |
| 5861 |
|
| 5862 |
<li>Workbench for Windows now uses the compiler makefile (.t3m) file |
| 5863 |
format to store its project information. This means that a Workbench |
| 5864 |
project file can be used directly as a compiler makefile, using |
| 5865 |
the compiler's "-f" option. For the moment, Workbench is still capable |
| 5866 |
of loading |
| 5867 |
|
| 5868 |
<li>Workbench on Windows now monitors for Ctrl+Break, and breaks into |
| 5869 |
the debugger when this key combination is detected. This allows |
| 5870 |
easily breaking into the debugger if the .t3 program enters an |
| 5871 |
infinite loop. |
| 5872 |
|
| 5873 |
<li>The 'replace' and 'modify' keywords can now be used to change |
| 5874 |
'grammar' definitions. Refer to the <a href="sysman/gramprod.htm">Grammar |
| 5875 |
Rules</a> documentation for details. |
| 5876 |
|
| 5877 |
<li>A grammar production object can now be declared without creating |
| 5878 |
any rules associated with the production. The new syntax is simply |
| 5879 |
"grammar <i>production_name</i>;" (that is, a "grammar" statement that |
| 5880 |
simply ends after the name of the production). This can be useful for |
| 5881 |
libraries that want to define rules that refer to productions for |
| 5882 |
which the library itself provides no rules, so that games based on the |
| 5883 |
library can fill in the grammar definitions for the productions. In |
| 5884 |
the past, if a production was referenced as a subproduction from one |
| 5885 |
or more rules but had no rules of its own defined, the linker |
| 5886 |
generated an error, because it is likely in such cases that the rules |
| 5887 |
referring to the undeclared production were misspelled and meant to |
| 5888 |
refer to a declared production; this new syntax gives the author a way |
| 5889 |
to tell the compiler explicitly that a production name was used |
| 5890 |
intentionally, even if the production has no rules. |
| 5891 |
|
| 5892 |
<li>Added new syntax that allows multiple part-of-speech properties |
| 5893 |
(such as "noun" or "adjective") to be used as a single token matcher |
| 5894 |
in a grammar rule. The new syntax uses a list of properties in |
| 5895 |
angle brackets: <tt><noun adjective plural></tt>. When |
| 5896 |
this syntax is used, an input token matching any of the part-of-speech |
| 5897 |
properties in the list matches the rule token position. |
| 5898 |
|
| 5899 |
<li>Moved the "build configuration" information that was formerly |
| 5900 |
stored in object (.t3o) files into the symbol (.t3s) files instead. |
| 5901 |
The compiler uses the build configuration data stored in these files |
| 5902 |
to determine if recompilation of a given source file is necessitated |
| 5903 |
by build configuration changes since the last time the file was |
| 5904 |
compiled. In the past, when the information was stored in the object |
| 5905 |
files, the compiler unnecessarily regenerated symbol files repeatedly |
| 5906 |
when compilations failed due to syntax errors, because compilation |
| 5907 |
didn't get far enough to store the build data. Moving the information |
| 5908 |
to the symbol files allows the compiler to skip symbol table |
| 5909 |
generation when a previous compilation generated a valid symbol file |
| 5910 |
for a given module. This saves time in the build-edit-build cycle |
| 5911 |
when a program is initially compiled and contains syntax errors. |
| 5912 |
|
| 5913 |
<li>Added two new pseudo-variable keywords: <tt>targetobj</tt> and |
| 5914 |
<tt>definingobj</tt>. These pseudo-variables are similar to |
| 5915 |
<tt>self</tt> and <tt>targetobj</tt>, in that they act like |
| 5916 |
read-only variables (i.e., you cannot assign values to them), and |
| 5917 |
they are automatically maintained by the interpreter to keep track |
| 5918 |
of the current method context. <tt>targetobj</tt> returns the "original |
| 5919 |
target object" of the current method; this is the object that was |
| 5920 |
targeted by the method call that reached the current method. The |
| 5921 |
target object is set each time a method is called normally or via |
| 5922 |
<tt>delegated</tt>, and remains the same as methods are invoked |
| 5923 |
via <tt>inherited</tt>. <tt>definingobj</tt> is the object that |
| 5924 |
defines the currently executing method; this is normally simply |
| 5925 |
the object where the method was actually defined in the program's |
| 5926 |
source code. |
| 5927 |
|
| 5928 |
<li>Removed the <tt>getMethodDefiner()</tt> intrinsic function from |
| 5929 |
the "tads-gen" function set. This function has been replaced by |
| 5930 |
the new pseudo-variable <tt>definingobj</tt>. |
| 5931 |
|
| 5932 |
<li>Changed the interface of the Object.propInherited() intrinsic |
| 5933 |
class method. The method now takes an additional argument (positionally |
| 5934 |
the second argument in the new interface) giving the original target |
| 5935 |
object of the call. In cases where the caller wishes to know |
| 5936 |
if the currently active method can inherit a base class method, the |
| 5937 |
value for the new argument should simply be <tt>targetobj</tt>. |
| 5938 |
|
| 5939 |
<li>Changed the way <tt>inherited</tt> behaves after |
| 5940 |
<tt>delegated</tt> is used. In the past, the inheritance mechanism |
| 5941 |
tried to find the defining object of the method with the |
| 5942 |
<tt>inherited</tt> operator in the inheritance tree of "self". After |
| 5943 |
<tt>delegated</tt>, the defining object is normally not related by |
| 5944 |
inheritance to "self", so the old search pattern normally failed to |
| 5945 |
find any inherited instance of the method. Now, the interpreter keeps |
| 5946 |
track internally of the "original target" object in addition to the |
| 5947 |
"self" object; the original target is always the target of the last |
| 5948 |
explicit method call or the target of the most recent |
| 5949 |
<tt>delegated</tt> operator. The <tt>inherited</tt> operator uses the |
| 5950 |
original target object as the starting point of the inheritance tree |
| 5951 |
search, rather than "self"; this allows <tt>inherited</tt> to find |
| 5952 |
methods inherited from base classes of the delegatee when appropriate. |
| 5953 |
|
| 5954 |
<li>Fixed a compiler bug that caused incorrect code to be generated |
| 5955 |
for statements like this: <tt>if (<i>constant_expr</i> && |
| 5956 |
<i>non_constant_expr</i>)</tt> - that is, an "if" whose condition |
| 5957 |
expression consists of a constant expression (i.e., an expression |
| 5958 |
whose value can be determined at compile-time) and a non-constant |
| 5959 |
expression joined by the "&&" operator. The code that the |
| 5960 |
compiler generated caused unpredictable results at run-time, and was |
| 5961 |
able to crash the interpreter in some cases. This has been corrected. |
| 5962 |
|
| 5963 |
<li>Increased the standard VM stack size to 4096 stack slots (from 1024). |
| 5964 |
|
| 5965 |
<li>Expanded the compiler's maximum symbol length to 80 characters, |
| 5966 |
to accomodate the longer symbols generated by the new treatment of |
| 5967 |
production match object tagged names as actual compiler symbols. |
| 5968 |
|
| 5969 |
<li>Fixed a problem that caused a sporadic interpreter crash when |
| 5970 |
using restartGame(). This crash occurred only rarely, and was related |
| 5971 |
to memory management during program re-initialization. This should no |
| 5972 |
longer occur. |
| 5973 |
|
| 5974 |
<li>Fixed a problem with restoreGame() that caused modifications to |
| 5975 |
intrinsic classes to be lost in some cases. This problem occurred |
| 5976 |
rarely, and should no longer occur. |
| 5977 |
|
| 5978 |
<li class=last>Changed the character mapping input file format slightly. The |
| 5979 |
"unicode_to_local" keyword has been renamed to "display_mappings", |
| 5980 |
and has a slightly different effect: in the "display_mappings" |
| 5981 |
section, each character mapping gives the <b>Unicode</b> expansion |
| 5982 |
of a Unicode code point; that is, each mapping specifies a set of |
| 5983 |
Unicode characters to substitute for the Unicode character being |
| 5984 |
mapped. The expansion is then further translated automatically by |
| 5985 |
the character mapper to the local character set. Each expansion |
| 5986 |
<b>must</b> map to characters defined in the one-to-one mapping |
| 5987 |
section (i.e., the set of mappings before the "display_mappings" |
| 5988 |
keyword). Note in particular that an expansion <b>cannot</b> |
| 5989 |
map to characters that are themselves further expanded. The purpose |
| 5990 |
of this change is to allow the interpreter to perform expansion |
| 5991 |
mappings - that is, mappings that can translate one Unicode character |
| 5992 |
to several display characters - while still in the Unicode domain, |
| 5993 |
and hence to perform operations such as word-wrapping on the expansions. |
| 5994 |
The console output formatter uses this to properly word-wrap lines with |
| 5995 |
expanded display mappings. |
| 5996 |
|
| 5997 |
</ul> |
| 5998 |
|
| 5999 |
|
| 6000 |
<h3>Changes for 03/16/2002</h3> |
| 6001 |
|
| 6002 |
<ul> |
| 6003 |
|
| 6004 |
<li>Fixed script-reading mode in the interpreter. Past versions did |
| 6005 |
not correctly read input scripts (using the command-line interpreter's |
| 6006 |
"-i" option, for example). |
| 6007 |
|
| 6008 |
<li>Added the new input event code INEVT_END_QUIET_SCRIPT, which is |
| 6009 |
described in the documentation for the |
| 6010 |
<a href="sysman/tadsio.htm">inputLineTimeout</a> |
| 6011 |
intrinsic function. |
| 6012 |
|
| 6013 |
<li>Added a couple of small usabilty enhancements to Workbench for Windows: |
| 6014 |
<ul> |
| 6015 |
<li>Pushing the Return/Enter key when keyboard focus is in the Project |
| 6016 |
window opens the selected module in a source file window, if a module |
| 6017 |
is selected. This allows easier keyboard navigation of the Project |
| 6018 |
file list. |
| 6019 |
<li>Double-clicking on a module in the Project window now moves keyboard |
| 6020 |
focus to the newly-opened source file window. In the past, focus |
| 6021 |
stayed on the Project window, so context-sensitive commands (such |
| 6022 |
as "Find") did not apply to the newly-opened source window until |
| 6023 |
manually clicking on the window to activate it. |
| 6024 |
</ul> |
| 6025 |
|
| 6026 |
<li>Fixed a bug in <tt>mkchrtab</tt> (the character map compiler) |
| 6027 |
that caused incorrect mappings in some compiled mapping files having |
| 6028 |
display (from_unicode_to_local) mappings that expanded to more than |
| 6029 |
one byte. |
| 6030 |
|
| 6031 |
<li class=last>Fixed a problem in the Windows interpreter that made it |
| 6032 |
incompatible with Windows 95. The interpreter should once again be |
| 6033 |
compatible with Windows 95. |
| 6034 |
|
| 6035 |
</ul> |
| 6036 |
|
| 6037 |
|
| 6038 |
<h3>Changes for 03/10/2002</h3> |
| 6039 |
|
| 6040 |
<ul> |
| 6041 |
|
| 6042 |
<li>Added the new method removeElement() to the <a href="sysman/vector.htm"> |
| 6043 |
Vector intrinsic class</a>. This new method removes an element by |
| 6044 |
value, modifying the vector in-place. |
| 6045 |
|
| 6046 |
<li>Added the new method forEachWord() to the <a href="sysman/dict.htm"> |
| 6047 |
Dictionary intrinsic class</a>. This new method provides a way of |
| 6048 |
enumerating all of the entries in a Dictionary object. |
| 6049 |
|
| 6050 |
<li>Added information to the LICENSE.TXT file making it clear that |
| 6051 |
derived versions of the library are permitted with few restrictions. |
| 6052 |
|
| 6053 |
<li>The "!" operator can now take an object reference as its operand; |
| 6054 |
when applied to a non-nil object reference, "!" yields nil. This |
| 6055 |
means that constructs such as "if (!obj)" are now treated as equivalent |
| 6056 |
to "if (obj == nil)"; such constructs formerly generated a run-time |
| 6057 |
error. In addition, property ID's, single-quoted strings, lists, |
| 6058 |
and function pointers can all be used as operands of "!", and "!" |
| 6059 |
applied to any of these types yields nil. |
| 6060 |
|
| 6061 |
<li>Fixed a compiler bug that caused the compiler to crash in some |
| 6062 |
cases when confronted with an empty pair of parentheses within a |
| 6063 |
grammar rule, such as <tt>grammar myProd: ('mytoken' ())</tt>. |
| 6064 |
|
| 6065 |
<li>Fixed a compiler bug that caused the compiler to crash in some |
| 6066 |
cases when given a method definition with no code body and the end of |
| 6067 |
the object immediately following. |
| 6068 |
|
| 6069 |
<li>Fixed a compiler bug that caused incorrect code generation for |
| 6070 |
an 'if' with a constant controlling expression that evaluated to |
| 6071 |
true and no 'else' clause. In such cases, the true branch of the |
| 6072 |
'if' was not generated; this has been corrected. |
| 6073 |
|
| 6074 |
<li>The project file extension for Workbench for Windows is now |
| 6075 |
".t3c" (it was formerly ".tdc", the same as it was for the TADS 2 |
| 6076 |
Workbench). The extension has been changed to allow the Windows |
| 6077 |
desktop to launch the appropriate version of Workbench when the user |
| 6078 |
double-clicks a project file from the desktop and both TADS 2 and |
| 6079 |
ADS 3 Workbench versions are installed. |
| 6080 |
|
| 6081 |
<li>Fixed a problem in the VM that caused repeated "terminate game" |
| 6082 |
dialogs to appear in Workbench for Windows when the user attempted |
| 6083 |
to compile the game after the debugger intercepted a run-time error. |
| 6084 |
|
| 6085 |
<li class=last>Fixed a problem in the character map compiler (mkchrtab) that |
| 6086 |
caused invalid map files to be generated if the source file had more |
| 6087 |
than one symmetric (bidirectional) mapping assigned to the same |
| 6088 |
Unicode code point. The character map compiler now generates a |
| 6089 |
warning when these collisions occur, and generates valid map files |
| 6090 |
even when collisions are present by ignoring redundant mappings. |
| 6091 |
|
| 6092 |
</ul> |
| 6093 |
|
| 6094 |
|
| 6095 |
<h3>Changes for 02/17/2002</h3> |
| 6096 |
|
| 6097 |
<ul> |
| 6098 |
|
| 6099 |
<li>The compiler now shows a summary count of warnings and errors at |
| 6100 |
the end of the compiler console output when either count is non-zero, |
| 6101 |
to make it more obvious that messages were generated during the |
| 6102 |
compilation. If many modules are included in a compilation, the |
| 6103 |
status messages that the compiler generates as it works through the |
| 6104 |
module list can make it easy to miss an error or warning mixed in |
| 6105 |
among all the status messages. The new summary at the end of the |
| 6106 |
compilation should make it easier to notice when something requires |
| 6107 |
attention. No summary counts are displayed when there are no warnings |
| 6108 |
or errors; this is intended to make it even easier to notice when |
| 6109 |
something is wrong, since authors will not be accustomed to seeing |
| 6110 |
a summary count at all when everything is well. |
| 6111 |
|
| 6112 |
<li>The <a href="sysman/iter.htm">Iterator intrinsic class</a> has the new |
| 6113 |
methods getCurVal() and getCurKey(), which return the value and key |
| 6114 |
of the current element of the iteration, respectively. For indexed |
| 6115 |
collections, the "key" is the index of the current element. |
| 6116 |
|
| 6117 |
<li>LookupTable.forEach() no longer passes the key argument to the |
| 6118 |
callback. If the key is desired, use the new method forEachAssoc() |
| 6119 |
instead. This allows LookupTable to be used more interchangeably |
| 6120 |
with other Collection subclasses, since its forEach() method has the |
| 6121 |
same interface as the corresponding method of other Collection |
| 6122 |
subclasses. |
| 6123 |
|
| 6124 |
<li>LookupTable, List, and Vector now have the additional method |
| 6125 |
forEachAssoc(func), which calls func(key,val) for each element of |
| 6126 |
the collection. For List and Vector, the "key" is the index of |
| 6127 |
the element; for LookupTable, it is the key for the entry. |
| 6128 |
|
| 6129 |
<li>The Array intrinsic class has been deleted; Vector should be used |
| 6130 |
instead. The Array class was too similar to the Vector class to |
| 6131 |
justify its existence as a separate type, so the functionality of |
| 6132 |
Array and Vector are now combined into the single Vector class. |
| 6133 |
|
| 6134 |
<li>When a Vector is used as the left-hand side of a '+' or '-' |
| 6135 |
operation, in the past, the VM modified the left-hand side Vector |
| 6136 |
object directly. This has been changed so that a new Vector is |
| 6137 |
created, and the original left-hand Vector is left unchanged. The |
| 6138 |
old behavior was confusing in that it gave the '+' and '-' operators |
| 6139 |
side effects, which is inconsistent with the behavior of the |
| 6140 |
operators in other situations. |
| 6141 |
|
| 6142 |
<li>A new Vector method, appendAll(), allows appending the individual |
| 6143 |
elements of a List or Vector to another Vector in-place (i.e., without |
| 6144 |
creating a new Vector object, as the '+' operator does). |
| 6145 |
|
| 6146 |
<li>The Vector methods getUnique() and subset() now return a new |
| 6147 |
Vector to store the result of the operation. In the past, these |
| 6148 |
methods modified the original Vector in place. |
| 6149 |
|
| 6150 |
<li>In the past, when a Vector was used as the right-hand side of a |
| 6151 |
'+' operator whose left-hand side was a List or Vector, the List or |
| 6152 |
Vector on the right was the single new element concatenated to the |
| 6153 |
left-hand collection. This was inconsistent with the handling of |
| 6154 |
List values; a List value concatenates its elements individually when |
| 6155 |
used as the right-hand side of a '+' operator. For consistency, |
| 6156 |
Vector now concatenates its elements individually when used on the |
| 6157 |
right side of a '+' operator. Similarly, Vector values now subtract |
| 6158 |
their elements from the left-hand side collection when used as the |
| 6159 |
right-hand side of a '-' operator, also for consistency with the List |
| 6160 |
type's behavior. |
| 6161 |
|
| 6162 |
<li class=last>Fixed a problem in the VM that caused the VM to lose track of |
| 6163 |
intrinsic class modifiers after a RESTORE operation. Intrinsic |
| 6164 |
class modifiers will now properly survive RESTORE operations. |
| 6165 |
|
| 6166 |
</ul> |
| 6167 |
|
| 6168 |
|
| 6169 |
|
| 6170 |
<h3>Changes for 02/09/2002</h3> |
| 6171 |
|
| 6172 |
<ul> |
| 6173 |
|
| 6174 |
<li>Changed <tt>inputLineTimeout</tt> so that it accepts a nil |
| 6175 |
timeout argument value. A nil value for the timeout is equivalent to |
| 6176 |
omitting the timeout argument entirely: it indicates that the input |
| 6177 |
should be allowed to proceed indefinitely. |
| 6178 |
|
| 6179 |
<li>Improved <tt>inputLineTimeout</tt>'s interaction with the OS |
| 6180 |
layer so that the portable code can handle complete non-implementation |
| 6181 |
of input-with-timeout by the OS layer. |
| 6182 |
|
| 6183 |
<li>Changed <tt>getTime(GETTIME_TICKS)</tt> so that the function always |
| 6184 |
chooses the zero point of the system clock as the time of the first |
| 6185 |
call to the function. This reduces the likelihood that a game will |
| 6186 |
encounter a roll-over of the system clock, which could lead to confusion |
| 6187 |
in interpreting time differences and the ordering of events. |
| 6188 |
|
| 6189 |
<li>Changed the names of two methods in the LookupTable intrinsic |
| 6190 |
class. The method formerly called countBuckets() is now |
| 6191 |
getBucketCount(), and the method formerly called countEntries() is |
| 6192 |
now getEntryCount(). These names match the names as given in the |
| 6193 |
documentation, but the header file (lookup.h) had the old names. |
| 6194 |
|
| 6195 |
<li>Added the compiler option "-clean", which causes the compiler |
| 6196 |
to skip ordinary compilation and instead simply remove all derived |
| 6197 |
files that the compilation would have produced; in particular, this |
| 6198 |
removes the symbol (.t3s), object (.t3o), and image (.t3) files that |
| 6199 |
the compilation would have produced. |
| 6200 |
|
| 6201 |
<li>Added the compiler option "-Pi", which causes the compiler to |
| 6202 |
skip ordinary compilation and instead write to the standard output a |
| 6203 |
list of files included with <tt>#include</tt> directives throughout |
| 6204 |
the program. The compiler runs the normal preprocessing, and shows |
| 6205 |
only files included in conditional compilation sections that are |
| 6206 |
selected in the compilation (in other words, the list does not |
| 6207 |
include any files included from within the false branches of |
| 6208 |
<tt>#if</tt> or other conditional compilation directives). In the |
| 6209 |
generated list, the files are listed one file per line, and each line |
| 6210 |
specifying a file consists of the characters "<tt>#include</tt>", |
| 6211 |
followed by a single space, followed by the name of the included |
| 6212 |
file, followed by a newline sequence. The name of the included file |
| 6213 |
isn't enclosed in any quote marks or other delimiters. This format |
| 6214 |
is intended to simplify automatic processing of the list by clearly |
| 6215 |
marking each line in the output that names an included file. Note |
| 6216 |
that the list of included files might include a given file more than |
| 6217 |
once, because each file is listed as it's included, and it is possible |
| 6218 |
to include a given file more than once. |
| 6219 |
|
| 6220 |
<li>When the compiler is run with the "-P" option (which writes the |
| 6221 |
preprocessed version of the source to standard output), the compiler |
| 6222 |
now prefixes the generated source with the directive <tt>#charset |
| 6223 |
"utf8"</tt> to indicate the character set of the preprocessed source. |
| 6224 |
|
| 6225 |
<li>Added a compiler warning message when the preprocessor finds a |
| 6226 |
line that ends with a backslash followed by whitespace. While this |
| 6227 |
format is legal (because it could be useful in defining a macro that |
| 6228 |
is later "stringized"), it is highly unusual. Since trailing spaces |
| 6229 |
are not usually visible in a text editor, the programmer might not |
| 6230 |
be aware of their presence; and since the presence of the trailing |
| 6231 |
spaces materially changes the meaning of the program, the compiler |
| 6232 |
warns about them. Note that the warning can be suppressed by adding |
| 6233 |
a comment at the end of the line; this doesn't change the meaning |
| 6234 |
of the program but does make the spaces visually evident in a text |
| 6235 |
editor, so the compiler recognizes that the warning isn't necessary |
| 6236 |
in this case. |
| 6237 |
|
| 6238 |
<li>Fixed a VM problem that caused the garbage collector to |
| 6239 |
incorrectly delete intrinsic class objects under certain unusual |
| 6240 |
circumstances. When an intrinsic class is used implicitly but never |
| 6241 |
specifically declared in the compiled program, the VM creates an |
| 6242 |
object to represent the intrinsic class during the initial program |
| 6243 |
load. In the past, it was possible for the garbage collector to |
| 6244 |
regard such an object as unreachable even though it is always |
| 6245 |
reachable via the native code implementing its corresponding |
| 6246 |
intrinsic class. This problem sometimes led to VM crashes. The |
| 6247 |
problem should no longer occur. |
| 6248 |
|
| 6249 |
<li>Fixed a compiler problem that caused incorrect compilation for a |
| 6250 |
grammar rule specified with an alternation (two or more sub-rules, |
| 6251 |
each separated by an "|" symbol) and an empty final sub-rule. In |
| 6252 |
such cases, the compiler incorrectly generated two copies of the |
| 6253 |
empty sub-rule, leading to two match objects being created at |
| 6254 |
run-time each time the empty sub-rule was matched. This has been |
| 6255 |
corrected. |
| 6256 |
|
| 6257 |
<li>Changed <tt>inherited</tt> so that it searches for the next |
| 6258 |
inherited definition of the property as though the currently active |
| 6259 |
method (and any overriding definitions) had simply never been |
| 6260 |
defined. This makes <tt>inherited</tt> work roughly the same way as |
| 6261 |
the <tt>inheritNext</tt> method that was formerly defined in the |
| 6262 |
<tt>MixIn</tt> class in the adventure game library (adv3). |
| 6263 |
|
| 6264 |
<li class=last>Added a new <tt>Object</tt> method, <tt>propInherited</tt>, which |
| 6265 |
determines if a method is inherited, using the new rules of the |
| 6266 |
<tt>inherited</tt> operator. This provides functionality equivalent |
| 6267 |
to the <tt>canInheritNext</tt> method formerly defined in the |
| 6268 |
<tt>MixIn</tt> class in the adventure game library. |
| 6269 |
|
| 6270 |
</ul> |
| 6271 |
|
| 6272 |
|
| 6273 |
<h3>Changes for 01/13/2002</h3> |
| 6274 |
|
| 6275 |
<ul> |
| 6276 |
|
| 6277 |
<li>The compiler can now read <a href="sysman/build.htm">"library" |
| 6278 |
files</a>, which are lists of |
| 6279 |
source files to be included in the compilation. Library files can be |
| 6280 |
used to simplify compiler command lines and makefiles when including |
| 6281 |
sets of source files that usually act as a group, such as the |
| 6282 |
standard adventure library sources. |
| 6283 |
|
| 6284 |
<li>Workbench can now show library files in the project window. You |
| 6285 |
can add a library file to the project window's source file list in |
| 6286 |
the same way as you can add a source file; the library shows its |
| 6287 |
contained source files as a subtree. Each source file within a |
| 6288 |
library is shown with a checkbox, indicating whether or not the file |
| 6289 |
is included in compilations; if you want to exclude a file within a |
| 6290 |
library from compilation, click on the checkbox to remove the |
| 6291 |
checkmark. The checkbox settings are stored with the project and |
| 6292 |
don't affect the library itself, so you can use the same library in a |
| 6293 |
different project, and include and exclude different sets of files. |
| 6294 |
|
| 6295 |
<li>The debugger no longer uses a RuntimeError exception to terminate |
| 6296 |
the program being debugged. In the past, when the user terminated |
| 6297 |
the running program using the debugger "Stop" button, or by starting |
| 6298 |
a new compilation of the program while the program was still running, |
| 6299 |
the debugger attempted to terminate the program by throwing a |
| 6300 |
RuntimeError with system error code 2390. This approach wasn't |
| 6301 |
completely reliable, because it allowed the running program to |
| 6302 |
catch the exception and keep running; programs sometimes inadvertantly |
| 6303 |
caught the error as part of an inclusive "catch" handler, causing |
| 6304 |
strange interactions with the debugger user interface. The debugger |
| 6305 |
now halts the program by telling the VM not to execute any more program |
| 6306 |
instructions, which guarantees that the program stops immediately. |
| 6307 |
This new approach should be much more robust and should avoid the |
| 6308 |
strange effects that sometimes occurred with the old mechanism. |
| 6309 |
|
| 6310 |
<li>Fixed a problem in the compiler that caused the compiler to hang |
| 6311 |
when given a makefile (a .t3m file) that didn't end with a newline |
| 6312 |
character. |
| 6313 |
|
| 6314 |
<li>Fixed a compiler problem that generated an incorrect set of |
| 6315 |
grammar rule patterns for grammars involving nested alternatives |
| 6316 |
(i.e., parenthesized "|" expressions). In the past, the compiler |
| 6317 |
incorrectly generated multiple copies of the top-level expressions |
| 6318 |
in such rules, leading to run-time generation of multiple redundant |
| 6319 |
matches for these expressions. This has been corrected; the compiler |
| 6320 |
now generates only one copy of each top-level rule in an alternation. |
| 6321 |
|
| 6322 |
<li>Fixed an interpreter problem that caused the interpreter to crash |
| 6323 |
when an HTML <TITLE> tag was displayed. |
| 6324 |
|
| 6325 |
<li>Fixed a problem in the debugger that caused memory leaks and |
| 6326 |
other incorrect behavior when the user attempted to run the program, |
| 6327 |
but the program had not been compiled (or had not been compiled with |
| 6328 |
debugging information). |
| 6329 |
|
| 6330 |
<li class=last>When Workbench needs to find a source file during program tracing |
| 6331 |
in the debugger, it now scans the project list to find the file. In |
| 6332 |
the past, the debugger used only the source path to find files, |
| 6333 |
leading to annoying interactive requests to locate files that were in |
| 6334 |
plain view in the project window. |
| 6335 |
|
| 6336 |
</ul> |
| 6337 |
|
| 6338 |
|
| 6339 |
<h3>Changes for 01/05/2002</h3> |
| 6340 |
|
| 6341 |
<ul> |
| 6342 |
|
| 6343 |
<li>Added the new intrinsic functions |
| 6344 |
<a href="sysman/tadsio.htm"><tt>inputLineTimeout()</tt></a>, |
| 6345 |
which allows reading a line of text with an optional timeout. This |
| 6346 |
function can be used to combine command-line input with real-time |
| 6347 |
effects, because it allows a command line to be interrupted if the |
| 6348 |
command isn't completed before a real-time interval elapses. |
| 6349 |
|
| 6350 |
<li class=last>Fixed a problem in the Dictionary class: the |
| 6351 |
<tt>isWordDefinedTrunc()</tt> method used the wrong truncation length |
| 6352 |
in its comparison - it required the string to be matched to be at |
| 6353 |
least one character longer than the dictionary's truncation length. |
| 6354 |
It now uses the correct truncation length. |
| 6355 |
|
| 6356 |
</ul> |
| 6357 |
|
| 6358 |
|
| 6359 |
<h3>Changes for 12/30/2001</h3> |
| 6360 |
|
| 6361 |
<ul> |
| 6362 |
|
| 6363 |
<li>The compiler now parses a <tt>delegated</tt> expression so that |
| 6364 |
the object expression is taken to exclude function or method calls. |
| 6365 |
That is, if parentheses follow the expression giving the target |
| 6366 |
object of the delegation, these are taken to give the argument list |
| 6367 |
of the delegation call itself, rather than of the expression giving |
| 6368 |
the target object value. This change makes <tt>delegated</tt> |
| 6369 |
syntactically parallel to <tt>inherited</tt> in that the target |
| 6370 |
property can be omitted from the expression, in which case the |
| 6371 |
delegation target property is the same as the property being |
| 6372 |
evaluated in the caller. (If a function or method call is desired |
| 6373 |
in the object expression itself, this can be easily accomplished |
| 6374 |
by enclosing the entire object expression in parentheses.) |
| 6375 |
|
| 6376 |
<li>Workbench now stores its project configuration files so that the |
| 6377 |
absolute file system path to "system" files is not stored; instead, |
| 6378 |
system files are flagged as system files, and their locations are |
| 6379 |
stored relative to the system directory. A "system" file is simply a |
| 6380 |
file that is stored in the Workbench install directory or any of its |
| 6381 |
subdirectories; the system directory is the directory containing the |
| 6382 |
Workbench program executable. This change makes project |
| 6383 |
configurations more readily moveable from one system to another, |
| 6384 |
because it eliminates any dependency in the project configuration |
| 6385 |
on the particular directory in which Workbench is installed. |
| 6386 |
|
| 6387 |
<li class=last>The compiler now treats the symbol and object path options as |
| 6388 |
overriding all module source paths, even when the filenames are given |
| 6389 |
with "absolute" (as opposed to relative) path names. |
| 6390 |
|
| 6391 |
</ul> |
| 6392 |
|
| 6393 |
|
| 6394 |
<h3>Changes for 12/23/2001</h3> |
| 6395 |
|
| 6396 |
<ul> |
| 6397 |
|
| 6398 |
<li>Added a checksum to the saved game format. This allows the |
| 6399 |
interpreter to validate a saved state file, to ensure the file wasn't |
| 6400 |
corrupted (such as by a text-mode ftp transfer), before attempting to |
| 6401 |
load the file. |
| 6402 |
|
| 6403 |
<li>Fixed a problem in the Vector intrinsic class that prevented two |
| 6404 |
equivalent vectors from comparing equal. |
| 6405 |
|
| 6406 |
<li>Fixed a compiler problem that caused the compiler to crash in |
| 6407 |
some cases when a symbol was redefined from function to another type. |
| 6408 |
|
| 6409 |
<li class=last>Fixed a compiler problem that caused incorrect initialization |
| 6410 |
of Dictionary objects in the image file in certain cases when |
| 6411 |
preinitialization ran (i.e., when compiling with the -d option). |
| 6412 |
|
| 6413 |
</ul> |
| 6414 |
|
| 6415 |
|
| 6416 |
<h3>Changes for 12/09/2001</h3> |
| 6417 |
|
| 6418 |
<ul> |
| 6419 |
|
| 6420 |
<li>The compiler now accepts URL-style portable path names in #include |
| 6421 |
directives, and in fact prefers them. Refer to the |
| 6422 |
<a href="sysman/preproc.htm">preprocessor chapter</a> for details. |
| 6423 |
|
| 6424 |
<li class=last>Added a new method, <a href="sysman/tadsobj.htm">createClone</a>, |
| 6425 |
to the TadsObject intrinsic class. This method returns a newly-created |
| 6426 |
object that is an identical copy of the original object. |
| 6427 |
|
| 6428 |
</ul> |
| 6429 |
|
| 6430 |
|
| 6431 |
|
| 6432 |
|
| 6433 |
<h3>Changes for 12/02/2001</h3> |
| 6434 |
|
| 6435 |
<ul> |
| 6436 |
|
| 6437 |
<li>Changed the tokenizer interface (in tok.t) to return a list of |
| 6438 |
token elements, rather than parallel value/type lists. Each token |
| 6439 |
element in the token list is a sublist, consisting of the following |
| 6440 |
values: |
| 6441 |
|
| 6442 |
<ul> |
| 6443 |
<li>[1] = token value, as set by the matched rule |
| 6444 |
<li>[2] = token type enum, as set by the matched rule |
| 6445 |
<li>[3] = original source text matched by the rule that matched the token |
| 6446 |
</ul> |
| 6447 |
|
| 6448 |
The tok.h header defines macros that extract these elements of a token; |
| 6449 |
these should be used rather than direct list elements to make your code |
| 6450 |
more readable. The macros are getTokVal(tok), getTokType(tok), and |
| 6451 |
getTokOrig(tok). So, if <tt>lst</tt> is a variable containing the |
| 6452 |
result of calling Tokenizer.tokenize(), and you want to retrieve |
| 6453 |
the type enum for the third token, you'd write <tt>getTokType(lst[3])</tt>. |
| 6454 |
|
| 6455 |
<li>Changed the tokenizer's rule specifications for greater power and |
| 6456 |
symmetry in creating rules: |
| 6457 |
|
| 6458 |
<ul> |
| 6459 |
<li>The "flags" entry has been eliminated. The functionality of the |
| 6460 |
only flag that was defined, TOKFLAG_SKIP, has been replaced with the |
| 6461 |
improved behavior of the rule processor. Since the processor method's |
| 6462 |
interface is now powerful enough to subsume the functionality of the |
| 6463 |
"skip" flag, the special case embodied in the flag is no longer needed. |
| 6464 |
|
| 6465 |
<li>The processor method (element [3] in the sublist defining a rule) |
| 6466 |
has a new interface. In the past, this method took a text match and |
| 6467 |
returned a token value. This interface meant that a given rule was |
| 6468 |
limited to generating exactly one token. The new interface takes |
| 6469 |
three arguments, and returns no value: |
| 6470 |
|
| 6471 |
<p><pre> |
| 6472 |
self.(processorProp)(<i>txt</i>, <i>typ</i>, <i>toks</i>) |
| 6473 |
</pre><p> |
| 6474 |
|
| 6475 |
<i>txt</i> is the text that matched the rule (this is the same as the |
| 6476 |
lone argument to the old interface). <i>typ</i> is the token type from |
| 6477 |
the rule (i.e., element [2] of the sublist defining the rule). |
| 6478 |
<i>toks</i> is a Vector containing the token list under construction. |
| 6479 |
The method must append the appropriate set of tokens to the Vector |
| 6480 |
in <i>toks</i>. The method is not required to append any tokens; the |
| 6481 |
rule in the default tokenizer rule set that matches whitespace, for |
| 6482 |
example, doesn't generate any tokens, since whitespace characters have |
| 6483 |
no significance other than separating tokens in the default rule set. |
| 6484 |
The rule is also allowed to generate more than one token; this is useful |
| 6485 |
for rules that generate certain tokens types only if they immediately |
| 6486 |
follow particular text patterns. Note that the processor method is |
| 6487 |
not required to use the <i>typ</i> value given, since each new token |
| 6488 |
the method adds to the result Vector can be of whatever type is |
| 6489 |
appropriate; the type information is included so that a single processor |
| 6490 |
method can be re-used for similar types of processing that produce |
| 6491 |
different token types. |
| 6492 |
</ul> |
| 6493 |
|
| 6494 |
<li>Changed the intrinsic GrammarProd.parseTokens() method to accept |
| 6495 |
tokens in the new format returned by the tokenizer. The method now |
| 6496 |
takes only two arguments, not three: the second argument that formerly |
| 6497 |
gave the token type list has been eliminated, since each element of |
| 6498 |
the token list now includes the type information along with the token |
| 6499 |
value information. |
| 6500 |
|
| 6501 |
<li>Changed the Dictionary and GrammarProd intrinsic classes to use |
| 6502 |
case-sensitive matching exclusively. Case sensitivity in the past |
| 6503 |
was inconsistent; all functions are now case-sensitive for |
| 6504 |
consistency. |
| 6505 |
|
| 6506 |
<li>The template inheritance mechanism is somewhat altered from its |
| 6507 |
first implementation. The 'inherited' keyword can now go anywhere |
| 6508 |
a template; the inherited token lists are treated as substitutions |
| 6509 |
for 'inherited' at the point at which it appears in the list. |
| 6510 |
Furthermore, the compiler now treats each template involving |
| 6511 |
inheritance as a macro defining all possible inherited templates; |
| 6512 |
when a template is used, it is matched based on the entire expansion |
| 6513 |
of the template, not on the partial superclass template. The net |
| 6514 |
effect is that a template definition involving an 'inherited' |
| 6515 |
token is identical to the implied set of fully expanded template |
| 6516 |
definitions. |
| 6517 |
|
| 6518 |
<li>The -Fs option can now be used to specify a search path for |
| 6519 |
source files, rather than a single path for all sources as it did in |
| 6520 |
the past. Multiple -Fs options can be specified; each one adds one |
| 6521 |
directory to the source search path. When a source file name is |
| 6522 |
specified in "relative" form (as defined by local filename |
| 6523 |
conventions), the compiler first looks for the file in the working |
| 6524 |
directory, then searches the directories specified with -Fs options, |
| 6525 |
in the order in which the options were specified. The compiler uses |
| 6526 |
the first instance of the file it finds. |
| 6527 |
|
| 6528 |
<li>The compiler automatically adds the system-dependent default |
| 6529 |
system library directory to the source search path. This directory |
| 6530 |
is always searched <i>after</i> all directories specified by |
| 6531 |
the user with -Fs options. In effect, the compiler adds an |
| 6532 |
extra -Fs option for the default system library directory after |
| 6533 |
all user-specified -Fs options. This allows library sources |
| 6534 |
(such as reflect.t or gameinfo.t) to be included in a build |
| 6535 |
configuration (in a .t3m file, for example) without any path |
| 6536 |
information; the compiler will automatically find these system |
| 6537 |
files using the implied -Fs setting. |
| 6538 |
|
| 6539 |
<li>The compiler's default system library and include directories are |
| 6540 |
now system-dependent. On DOS and Windows systems, the default |
| 6541 |
system header and library directories are the same as the compiler |
| 6542 |
executable's directory (this is the main directory where the TADS 3 |
| 6543 |
tools are installed). Check your platform-specific release notes |
| 6544 |
for details on the locations of these directories on other platforms. |
| 6545 |
|
| 6546 |
<li>Fixed a problem that allowed objects to be deleted by the |
| 6547 |
garbage collector when they were referenced as superclasses of |
| 6548 |
other objects. This caused unpredictable behavior, including |
| 6549 |
interpreter crashes. |
| 6550 |
|
| 6551 |
<li>Fixed a problem that affected the results of t3GetStackTrace() in |
| 6552 |
the non-debug interpreter when a run-time error occurred. In such |
| 6553 |
cases, the stack trace incorrectly omitted the innermost level, |
| 6554 |
where the error actually occurred. This has been corrected. |
| 6555 |
|
| 6556 |
<li>Fixed a compiler problem that sometimes caused the compiler to |
| 6557 |
crash after attempting a link that involved unresolved external |
| 6558 |
symbol references. |
| 6559 |
|
| 6560 |
<li class=last>Fixed a GrammarProd parsing problem that caused incorrect token |
| 6561 |
index information to be returned in certain cases involving productions |
| 6562 |
with no tokens. |
| 6563 |
|
| 6564 |
</ul> |
| 6565 |
|
| 6566 |
|
| 6567 |
<h3>Changes for 11/17/2001</h3> |
| 6568 |
|
| 6569 |
<ul> |
| 6570 |
|
| 6571 |
<li>Extended the <a href="sysman/objdef.htm">object template</a> |
| 6572 |
syntax to allow template inheritance. A template definition can now |
| 6573 |
include the keyword "<tt>inherited</tt>" as its final token; this |
| 6574 |
indicates that the template "inherits" the templates of its |
| 6575 |
class's superclasses. |
| 6576 |
|
| 6577 |
<li>The compiler now detects and reports circular class definitions |
| 6578 |
(that is, class definitions where the class being defined is a subclass |
| 6579 |
of one or more its purported superclasses). In the past, the compiler |
| 6580 |
did not detect such definitions and could get stuck in infinite loops |
| 6581 |
or unbounded recursion when they were made. |
| 6582 |
|
| 6583 |
<li>Fixed a compiler problem that sometimes caused crashes when an |
| 6584 |
actual parameter list in a macro expansion was not properly terminated |
| 6585 |
(with a closing parenthesis) in the source file. |
| 6586 |
|
| 6587 |
<li>Fixed a problem that affected a few Vector methods by incorrectly |
| 6588 |
returning an empty vector. This affected the appendUnique, getUnique, |
| 6589 |
and mapAll methods. |
| 6590 |
|
| 6591 |
<li>Fixed a compiler problem that caused a modified intrinsic class |
| 6592 |
to show a spurious extra property in its getPropList() result list. |
| 6593 |
This property had an undefined type (type code 16). |
| 6594 |
|
| 6595 |
<li>Fixed a problem in the Vector class that caused unpredictable |
| 6596 |
results, including crashes, when adding a large list to a vector. |
| 6597 |
|
| 6598 |
<li>Fixed a problem in the debugger that caused unpredictable |
| 6599 |
results, including crashes, when interrupting the program in |
| 6600 |
mid-statement in certain circumstances. The problem occurred |
| 6601 |
sporadically in such cases when the garbage collector happened to run |
| 6602 |
while the debugger had control, but didn't appear until after |
| 6603 |
returning control to the program. This problem only manifested |
| 6604 |
itself rarely, but could cause crashes when it did appear. |
| 6605 |
|
| 6606 |
<li>Fixed a compiler problem that caused incorrect code to be |
| 6607 |
generated for calls to operator <tt>new</tt> where the actual |
| 6608 |
parameters included one or more "..." expressions (i.e., expanded |
| 6609 |
variable argument lists). This affected the <i>calling</i> end, |
| 6610 |
not the receiving end. The problem caused the caller to send one |
| 6611 |
fewer argument than it should have. |
| 6612 |
|
| 6613 |
<li>Fixed a problem in the output formatter that caused log files |
| 6614 |
to be generated without proper line wrapping in the HTML version |
| 6615 |
of the interpreter. |
| 6616 |
|
| 6617 |
<li class=last>Changed the output formatter so that <BANNER> contents |
| 6618 |
(everything from a <BANNER> tag to the corresponding |
| 6619 |
</BANNER> close tag) are not included in the output log. |
| 6620 |
The contents of a banner are not logically part of the main text |
| 6621 |
stream so are not appropriate for inclusion in a log file. This |
| 6622 |
ensures that HTML-based status lines and other special display |
| 6623 |
effects do not interfere with the log file contents. |
| 6624 |
|
| 6625 |
</ul> |
| 6626 |
|
| 6627 |
|
| 6628 |
<h3>Changes for 10/21/2001</h3> |
| 6629 |
|
| 6630 |
<ul> |
| 6631 |
|
| 6632 |
<li>Fixed a problem that made it impossible to use anonymous functions |
| 6633 |
that referenced "self" or properties of "self" within property values |
| 6634 |
defined as simple value expressions (as opposed to methods). |
| 6635 |
|
| 6636 |
<li class=last>Changed the compiler to allow using short-form anonymous functions |
| 6637 |
(i.e., using the "<tt>{args: }</tt>" notation, rather than the "<tt>new |
| 6638 |
function</tt>" notation) as list elements without enclosing the |
| 6639 |
functions in parentheses. In the past, the compiler considered an |
| 6640 |
open brace at the start of a list element expression as an error; this |
| 6641 |
was an heuristic intended to catch unterminated list expressions, but |
| 6642 |
its utility as a diagnostic tool was not sufficient to justify the |
| 6643 |
superfluous syntax requirement it imposed for this case. |
| 6644 |
|
| 6645 |
</ul> |
| 6646 |
|
| 6647 |
|
| 6648 |
|
| 6649 |
|
| 6650 |
<h3>Changes for 10/07/2001</h3> |
| 6651 |
|
| 6652 |
<ul> |
| 6653 |
|
| 6654 |
<li>Added special character sequences '\{' and '\}'. These are used |
| 6655 |
to group a set of output formatter setting changes: any changes to |
| 6656 |
the formatter settings made after a '\{' sequence are undone at the |
| 6657 |
corresponding '\}' sequence. In particular, the following state |
| 6658 |
changes are affected: |
| 6659 |
|
| 6660 |
<ul> |
| 6661 |
<li>\H+ |
| 6662 |
<li>\H- |
| 6663 |
<li>\H |
| 6664 |
</ul> |
| 6665 |
|
| 6666 |
These new sequences can be used to isolate a run of text from the |
| 6667 |
enclosing text's formatter settings, so that the text within the '\{ |
| 6668 |
\}' pair doesn't have to worry about the enclosing settings and has |
| 6669 |
no effect on the enclosing settings. This can be useful, for |
| 6670 |
example, if a run of text wants to output an HTML-significant |
| 6671 |
character, but doesn't know if it will be called with HTML |
| 6672 |
interpretation turned on or off. In such cases, the text can |
| 6673 |
turn HTML interpretation off within the brackets without affecting |
| 6674 |
its caller: "\{\H-&\}" would display an ampersand, regardless |
| 6675 |
of whether HTML mode was in effect before the text was displayed, |
| 6676 |
but will have no effect on subsequent text's HTML mode. |
| 6677 |
|
| 6678 |
<li>Fixed problems in several intrinsic classes related to saving |
| 6679 |
and restoring. These bugs caused crashes in some cases when restoring |
| 6680 |
saved positions. |
| 6681 |
|
| 6682 |
<li>Changes the restartGame() behavior slightly. The function invoked |
| 6683 |
after the restart is now passed the original command line arguments |
| 6684 |
to the program; the arguments are passed as a list in the second |
| 6685 |
parameter to the function. This allows the function to invoke |
| 6686 |
the normal main program entrypoint as though the program were being |
| 6687 |
started normally. |
| 6688 |
|
| 6689 |
<li>If a saved position file is found to be corrupted in the course |
| 6690 |
of being restored, the interpreter will now force an exit. There is |
| 6691 |
no way for the program to retain control in such cases. If a saved |
| 6692 |
position file is corrupted, the partially restored machine state at |
| 6693 |
the point at which the corruption is detected must be considered |
| 6694 |
invalid, so the VM cannot safely pass control back to the program. |
| 6695 |
In such cases, the VM terminates the program to avoid the high |
| 6696 |
likelihood that the program would crash the VM due to the program's |
| 6697 |
partially corrupted internal state. |
| 6698 |
|
| 6699 |
<li>Fixed some problems in the "undo" mechanism that caused |
| 6700 |
unpredictable behavior (including VM crashes) under some |
| 6701 |
circumstances. |
| 6702 |
|
| 6703 |
<li class=last>Fixed a problem in the debugger that caused, in some cases, the |
| 6704 |
incorrect error code to be reported in the RuntimeError object |
| 6705 |
representing a VM exception. This only occurred when the program |
| 6706 |
was being run in the debugger, and only then when certain types of |
| 6707 |
expressions were evaluated. This has been corrected. |
| 6708 |
|
| 6709 |
</ul> |
| 6710 |
|
| 6711 |
|
| 6712 |
|
| 6713 |
<h3>Changes for 09/30/2001</h3> |
| 6714 |
|
| 6715 |
<ul> |
| 6716 |
|
| 6717 |
<li class=last>Changed the symbol file format to allow inclusion of intrinsic |
| 6718 |
function and intrinsic class registration lists. This is an internal |
| 6719 |
change only; its purpose is to make the compiler more flexible in |
| 6720 |
correlating the internal linkage identifiers of intrinsics across |
| 6721 |
object modules to eliminate the possibility of certain confusing |
| 6722 |
linking errors. In the past, it was necessary to keep intrinsic |
| 6723 |
definitions in a consistent order across separately compiled modules, |
| 6724 |
which was problematic for library developers and especially for library |
| 6725 |
extension developers. Adding the information to the symbol files |
| 6726 |
allows the compiler to build an intrinsic identifier list globally |
| 6727 |
across modules to ensure a consistent ordering, even when the |
| 6728 |
individual modules have conflicting orderings. This change should |
| 6729 |
not be visible to users except to the extent that it eliminates |
| 6730 |
certain errors relating to intrinsic class and intrinsic function |
| 6731 |
inclusion order. |
| 6732 |
|
| 6733 |
</ul> |
| 6734 |
|
| 6735 |
|
| 6736 |
<h3>Changes for 09/09/2001</h3> |
| 6737 |
|
| 6738 |
<ul> |
| 6739 |
|
| 6740 |
<li>Added a new function to the <a href="sysman/tadsio.htm">"tads-io" function |
| 6741 |
set</a>: <tt>flushOutput()</tt>, which immediately flushes text output |
| 6742 |
to the display and updates the window, if possible. |
| 6743 |
|
| 6744 |
<li>Fixed a compiler bug that caused incorrect code to be generated |
| 6745 |
for implicit constructors for classes with multiple superclasses. |
| 6746 |
This code generation error did not manifest itself frequently, but |
| 6747 |
when it did show up caused problems ranging from data value corruption |
| 6748 |
to interpreter crashes. |
| 6749 |
|
| 6750 |
<li class=last>The debugger now includes an ampersand prefix when displaying |
| 6751 |
property pointer values. |
| 6752 |
|
| 6753 |
</ul> |
| 6754 |
|
| 6755 |
|
| 6756 |
<h3>Changes for 08/26/2001</h3> |
| 6757 |
|
| 6758 |
<ul> |
| 6759 |
|
| 6760 |
<li>Added new syntax that provides a short-hand notation for defining |
| 6761 |
a group of properties with similar names and parameters: the new |
| 6762 |
<a href="sysman/objdef.htm">"propertyset" syntax</a>. |
| 6763 |
|
| 6764 |
<li>Added a new keyword, "targetprop", a pseudo-variable that |
| 6765 |
evaluates to the current target property pointer. The target |
| 6766 |
property is the property that was invoked to reach the current |
| 6767 |
method; this new pseudo-variable complements "self" with information |
| 6768 |
on the property being evaluated in the current "self" object. The |
| 6769 |
"targetprop" keyword can only be used in contexts where "self" is |
| 6770 |
valid. |
| 6771 |
|
| 6772 |
<li>The "inherited" and "delegated" keywords can be used with new |
| 6773 |
syntax that omits the target property. If the target property is |
| 6774 |
omitted, then the current target property is implied. The target |
| 6775 |
property can be omitted from any of the previously-allowed forms of |
| 6776 |
the "inherited" and "delegated" expressions, as shown here ("delegated" |
| 6777 |
syntax is parallel to "inherited", so only "inherited" is shown): |
| 6778 |
|
| 6779 |
<ul> |
| 6780 |
<li><tt>inherited</tt> is equivalent to <tt>inherited.targetprop</tt> |
| 6781 |
<li><tt>inherited(<i>arguments</i>)</tt> is equivalent to |
| 6782 |
<tt>inherited.targetprop(<i>arguments</i>)</tt> |
| 6783 |
<li><tt>inherited <i>superclass_name</i></tt> is equivalent to |
| 6784 |
<tt>inherited <i>superclass_name</i>.targetprop</tt> |
| 6785 |
<li><tt>inherited <i>superclass_name</i>(<i>arguments</i>)</tt> |
| 6786 |
is equivalent to |
| 6787 |
<tt>inherited <i>superclass_name</i>.targetprop(<i>arguments</i>)</tt> |
| 6788 |
</ul> |
| 6789 |
|
| 6790 |
<li>Added a new library module, reflect.t, that provides higher-level |
| 6791 |
reflection services. This module is optional, but if it is included, |
| 6792 |
the _main.t module uses reflection to show stack trace listings for |
| 6793 |
unhandled runtime exceptions. |
| 6794 |
|
| 6795 |
<li>Added <a href="sysman/t3vm.htm">t3GetStackTrace()</a> to |
| 6796 |
the 't3vm' intrinsic function set. This function returns information |
| 6797 |
on the call stack. |
| 6798 |
|
| 6799 |
<li>The RuntimeException object defined in _main.t now stores a stack |
| 6800 |
trace (in the form returned by t3GetStackTrace()) in its stack_ |
| 6801 |
property. The VM no longer stores an explicit stringized form of |
| 6802 |
the stack trace when setting the exception message, since the new |
| 6803 |
stack trace format is more powerful. |
| 6804 |
|
| 6805 |
<li>Fixed a bug in the TadsObject intrinsic class that sometimes |
| 6806 |
caused a given property to appear more than once in the getPropList() |
| 6807 |
method's returned list. Any given property now appears at most once |
| 6808 |
in the result list. |
| 6809 |
|
| 6810 |
<li>The TadsObject intrinsic class now supports createInstance() as a |
| 6811 |
static method on the intrinsic class. The expression |
| 6812 |
TadsObject.createInstance() returns a new instance of TadsObject, |
| 6813 |
which is the same as defining an object statically like so: "myobj: |
| 6814 |
object;" - that is, using the "object" keyword rather than a |
| 6815 |
superclass list. |
| 6816 |
|
| 6817 |
<li>Fixed a bug in the getPropList() method when called on any |
| 6818 |
intrinsic class object (e.g., Object, TadsObject, BigNumber). In |
| 6819 |
the past, this method returned a list of all of the methods that |
| 6820 |
were valid on <i>instances</i> of the intrinsic class, not the |
| 6821 |
methods that were necessarily valid on the intrinsic class object |
| 6822 |
itself. This method now returns a list consisting only of the |
| 6823 |
"static" methods of the intrinsic class, which is to say the methods |
| 6824 |
that can be called directly on the intrinsic class object itself. |
| 6825 |
|
| 6826 |
<li>Fixed a bug in the Object intrinsic class's propType() method. |
| 6827 |
When the property in question was undefined, the method returned |
| 6828 |
TYPE_NIL, whereas it should have returned nil. The method now |
| 6829 |
returns nil for these cases, as documented. |
| 6830 |
|
| 6831 |
<li>Fixed a bug in the compiler that caused incorrect code generation |
| 6832 |
when a variable argument list parameter variable was referenced from |
| 6833 |
within an anonymous function within the function or method with the |
| 6834 |
variable argumetn list parameter. |
| 6835 |
|
| 6836 |
<li class=last>The compiler now specifially flags code using '=' to define a |
| 6837 |
method. Since this was valid TADS 2 syntax, and has been |
| 6838 |
gratuitously changed in TADS 3, users are likely to use the old |
| 6839 |
syntax accidentally, especially while transitioning to the new |
| 6840 |
language. The compiler catches these cases so that it can generate |
| 6841 |
specific and clear error messages; this should help ease the |
| 6842 |
transition to the new syntax by spelling out plainly the new |
| 6843 |
syntax requirement. |
| 6844 |
|
| 6845 |
</ul> |
| 6846 |
|
| 6847 |
|
| 6848 |
<h3>Changes for 08/12/2001</h3> |
| 6849 |
|
| 6850 |
<ul> |
| 6851 |
|
| 6852 |
<li>Fixed a compiler problem that caused incorrect code to be generated |
| 6853 |
for expressions of the form <tt>obj.(prop)(args)</tt>, where <tt>prop</tt> |
| 6854 |
is a property of <tt>self</tt> whose value is a property pointer. |
| 6855 |
An expressions of this form is equivalent to the form |
| 6856 |
<tt>obj.(self.prop)(args)</tt>, but the compiler in the past incorrectly |
| 6857 |
interpreted this as equivalent to <tt>obj.prop(args)</tt> - that is, |
| 6858 |
rather than evaluating <tt>(self.prop)</tt> and then calling the |
| 6859 |
property of <tt>obj</tt> given by the resulting property pointer value |
| 6860 |
with the given argument list <tt>args</tt>, |
| 6861 |
the compiler generated code that called the property <tt>prop</tt> |
| 6862 |
of <tt>obj</tt> with arguments <tt>args</tt>. This has been corrected - |
| 6863 |
the compiler now correctly interprets <tt>obj.(prop)(args)</tt> |
| 6864 |
as equivalent to <tt>obj.(self.prop)(args)</tt>. |
| 6865 |
|
| 6866 |
<li>Fixed a compiler problem that caused incorrect code to be generated |
| 6867 |
for <tt>delegated</tt> expressions involving variable argument lists. |
| 6868 |
|
| 6869 |
<li>Fixed a compiler problem that caused a spurious warning under |
| 6870 |
certain circumstances. If a property was used only in an address |
| 6871 |
expression ("&prop") in a module, and no object ever defined |
| 6872 |
a value for the property, a call to the property in a separate |
| 6873 |
module incorrectly generated a warning indicating a call to a |
| 6874 |
possibly undefined property name. This warning was spurious because |
| 6875 |
the use of the property name in an address expression is enough to |
| 6876 |
definitively establish the symbol as a property. |
| 6877 |
|
| 6878 |
<li>Fixed an output formatter problem that caused the text-mode |
| 6879 |
interpreter to hang (in an infinite loop internally) in response to |
| 6880 |
certain "&" entities in HTML mode. |
| 6881 |
|
| 6882 |
<li class=last>Fixed a problem in the GrammarProd intrinsic class that caused |
| 6883 |
productions that matched zero tokens to indicate invalid token index |
| 6884 |
values for firstTokenIndex and lastTokenIndex. These now always |
| 6885 |
indicate zero in such case, to indicate that the production is |
| 6886 |
associated with no tokens. |
| 6887 |
|
| 6888 |
</ul> |
| 6889 |
|
| 6890 |
|
| 6891 |
|
| 6892 |
<h3>Changes for 08/05/2001</h3> |
| 6893 |
|
| 6894 |
<ul> |
| 6895 |
|
| 6896 |
<li>Added file safety level checking to the File intrinsic class. The |
| 6897 |
initial implementation of File did not check the safety level set in the |
| 6898 |
user preferences; the File class now correctly checks to ensure each |
| 6899 |
open-file operation is allowed by the user's safety level settings. |
| 6900 |
On a safety level violation, the "open" functions throw the new |
| 6901 |
exception FileSafetyException. |
| 6902 |
|
| 6903 |
<li class=last>Text files can now be opened in FileAccessReadWriteKeep and |
| 6904 |
FileAccessReadWriteTrunc modes. In the past, only "data" and "raw" |
| 6905 |
files could be opened in read/write modes, which made it impossible |
| 6906 |
to append to an existing text file. |
| 6907 |
|
| 6908 |
</ul> |
| 6909 |
|
| 6910 |
|
| 6911 |
|
| 6912 |
<h3>Changes for 07/22/2001</h3> |
| 6913 |
|
| 6914 |
<ul> |
| 6915 |
|
| 6916 |
<li>Fixed a problem with using 'modify' with intrinsic classes. In the |
| 6917 |
past, if more than one 'modify' statement was applied to an intrinsic |
| 6918 |
class, only the last of the 'modify' statements was actually taken into |
| 6919 |
account at run-time. This has been corrected. |
| 6920 |
|
| 6921 |
<li class=last>Fixed a compiler bug: the compiler did not report an error if a |
| 6922 |
'replace' statement replaced an object but did not specify a superclass |
| 6923 |
list for the new object. The compiler misinterpreted such a statement as |
| 6924 |
a new anonymous object definition. This has been corrected; the compiler |
| 6925 |
now flags the missing superclass list as an error. |
| 6926 |
|
| 6927 |
</ul> |
| 6928 |
|
| 6929 |
|
| 6930 |
<h3>Changes for 07/16/2001</h3> |
| 6931 |
|
| 6932 |
<ul> |
| 6933 |
|
| 6934 |
<li>Fixed a problem in the List class that could cause an object to |
| 6935 |
be improperly deleted by the garbage collector under certain obscure |
| 6936 |
circumstances. (In particular, if an object was being assigned to |
| 6937 |
a list element, and the garbage collector ran in the course of the |
| 6938 |
creation of the new list for the result of the assignment, the object |
| 6939 |
on the right-hand side of the assignment was lost if not otherwise |
| 6940 |
referenced.) |
| 6941 |
|
| 6942 |
<li>Fixed a problem that occurred with <tt>propDefined(prop, |
| 6943 |
PROPDEF_GET_CLASS)</tt> when the property of interest was an |
| 6944 |
intrinsic method (i.e., a TYPE_NATIVE_CODE value). In these cases, |
| 6945 |
the return value of the method was an invalid value, which caused |
| 6946 |
problems if used, including interpreter crashes. In such cases, |
| 6947 |
<tt>propDefined()</tt> now properly returns the intrinsic class |
| 6948 |
object where the intrinsic method is defined. |
| 6949 |
|
| 6950 |
<li>Extended the <a href="sysman/objdef.htm">object template</a> |
| 6951 |
mechanism to allow class-specific templates to be defined. |
| 6952 |
|
| 6953 |
<li>Extended the <a href="sysman/tadsgen.htm">firstObj()</a> and |
| 6954 |
<a href="sysman/tadsgen.htm">nextObj()</a> intrinsic functions to |
| 6955 |
take a new <i>flags</i> argument, which allows the caller to specify |
| 6956 |
whether to enumerate instances only, classes only, or both. |
| 6957 |
|
| 6958 |
<li>Changed the TadsObject class to allow use of the <tt>new</tt> |
| 6959 |
operator with no arguments. In the past, at least one argument |
| 6960 |
(giving the immediate superclass of the new object) was required; |
| 6961 |
now a <tt>new TadsObject</tt> with no arguments is understood to |
| 6962 |
create a base TadsObject. |
| 6963 |
|
| 6964 |
<li>Added the <a href="sysman/file.htm">File intrinsic class</a>, which |
| 6965 |
provides a new interface to external file input/output. This replaces |
| 6966 |
the file-related functions in the <a href="sysman/tadsio.htm">"tads-io" |
| 6967 |
intrinsic function set</a>, which have been removed. Specifically, |
| 6968 |
the following functions have been removed: |
| 6969 |
<ul> |
| 6970 |
<li><tt>fileClose</tt> |
| 6971 |
<li><tt>fileGetPos</tt> |
| 6972 |
<li><tt>fileOpen</tt> |
| 6973 |
<li><tt>fileRead</tt> |
| 6974 |
<li><tt>fileSeek</tt> |
| 6975 |
<li><tt>fileSeekEnd</tt> |
| 6976 |
<li><tt>fileWrite</tt> |
| 6977 |
</ul> |
| 6978 |
<b>Important note: This change is not upwardly compatible.</b> All existing |
| 6979 |
code must be recompiled for this change, and any code using the fileXxx |
| 6980 |
functions must be modified to use the new File intrinsic class. The |
| 6981 |
necessary code changes are relatively straightforward, since the names |
| 6982 |
of the new File methods are similar to those of the old functions. |
| 6983 |
|
| 6984 |
<li>The compiler now generates an implicit constructor for each |
| 6985 |
object or class that inherits from multiple base classes and does |
| 6986 |
not provide an explicit constructor. The implicit constructor |
| 6987 |
simply invokes each base class's constructor, in the same order |
| 6988 |
in which the base classes are listed in the superclass list. |
| 6989 |
|
| 6990 |
<li>Added grouped sub-alternatives to rules in the |
| 6991 |
<a href="sysman/gramprod.htm"><tt>grammar</tt> statement</a>. This allows |
| 6992 |
portions of an alternative in a rule definition to be grouped for |
| 6993 |
alternation; for example, a rule can be defined as |
| 6994 |
"<tt>('take' | 'get' | 'pick' 'up') nounList->lst_</tt>", which |
| 6995 |
is more concise than flattening out the grouped alternation manually. |
| 6996 |
|
| 6997 |
<li>Added the <a href="sysman/preproc.htm"><tt>#ifempty</tt> and |
| 6998 |
<tt>#ifnempty</tt></a> variable-arguments expansion operators, |
| 6999 |
which allow conditional expansion in a varargs macro depending on |
| 7000 |
whether or not the varargs part is empty. |
| 7001 |
|
| 7002 |
<li>Added the -P option to t3make: this preprocesses the source file, |
| 7003 |
writing the expanded results on standard output. When -P is |
| 7004 |
specified, no compilation or linking is performed, so no object or |
| 7005 |
image files are created. |
| 7006 |
|
| 7007 |
<li>Added new <a href="sysman/string.htm">String intrinsic class</a> |
| 7008 |
methods: <tt>startsWith()</tt>, <tt>endsWith()</tt>, and |
| 7009 |
<tt>mapToByteArray</tt>. |
| 7010 |
|
| 7011 |
<li>Added a feature to the <tt>substr()</tt> method of the |
| 7012 |
<a href="sysman/string.htm">String intrinsic class</a>: if the starting |
| 7013 |
index (the first argument) is negative, it indicates an offset |
| 7014 |
from the end of the string: -1 is the last character of the string, |
| 7015 |
-2 the second-to-last, and so on. |
| 7016 |
|
| 7017 |
<li>Added a new function to the <a href="sysman/tadsio.htm">"tads-io" function |
| 7018 |
set</a>: <tt>getLocalCharSet</tt>, which returns the name of one of the |
| 7019 |
active local character sets on the current system. |
| 7020 |
|
| 7021 |
<li>Added new functionality to the <a href="sysman/tadsio.htm">"tads-io" |
| 7022 |
function set</a> for files. Files can now be opened in "raw" mode, |
| 7023 |
which allows reading and writing byte arrays. Bytes written to and |
| 7024 |
read from a file in raw mode are not translated or modified in any |
| 7025 |
way; this mode offers direct access to external files, for purposes |
| 7026 |
such as manipulating files in formats defined by other applications. |
| 7027 |
The <tt>fileRead()</tt> and <tt>fileWrite()</tt> functions in this |
| 7028 |
mode take ByteArray arguments. |
| 7029 |
|
| 7030 |
<li>Added new functionality to the <a href="sysman/tadsio.htm">"tads-io" |
| 7031 |
function set</a>: the <tt>fileOpen()</tt> routine can now take an |
| 7032 |
object of intrinsic class <a href="sysman/charset.htm">CharacterSet</a> |
| 7033 |
instead of a character set name. If you've already instantiated |
| 7034 |
a CharacterSet object for other reasons, it is more efficient to |
| 7035 |
re-use the same object by reference in this manner than to pass |
| 7036 |
the name of the character set to <tt>fileOpen()</tt>, since |
| 7037 |
<tt>fileOpen()</tt> has to create another mapping object when |
| 7038 |
given only a character set name. |
| 7039 |
|
| 7040 |
<li>Added the new <a href="sysman/charset.htm">CharacterSet</a> intrinsic |
| 7041 |
class. |
| 7042 |
|
| 7043 |
<li>Added the new <a href="sysman/bytearr.htm">ByteArray</a> intrinsic |
| 7044 |
class. |
| 7045 |
|
| 7046 |
<li>In the <a href="sysman/objic.htm">Object intrinsic class</a>, method |
| 7047 |
formerly known as <tt>isClass()</tt> has been renamed to |
| 7048 |
<tt>ofKind()</tt>. x.ofKind(y) returns true if x is an instance or |
| 7049 |
subclass or y. In addition, this method has been changed so that |
| 7050 |
x.ofKind(x) returns true for any x. |
| 7051 |
|
| 7052 |
<li>Added a built-in character set mapping for ISO 8859-1 (Latin-1). |
| 7053 |
This character set is in widespread use because of its status as the |
| 7054 |
default HTTP character set, and has an especially simple mapping to |
| 7055 |
Unicode, so it seemed worthwhile to add as a built-in set not requiring |
| 7056 |
an external mapping file. The assigned name of the set is "iso-8859-1". |
| 7057 |
|
| 7058 |
<li>Changed the compiler's former <tt>-r</tt> option to <tt>-a</tt>, |
| 7059 |
and the former <tt>-rl</tt> to <tt>-al</tt>. (The <tt>-a</tt> option |
| 7060 |
forces recompilation of all involved modules even when not out of |
| 7061 |
date with respect to the source files, and <tt>-al</tt> forces |
| 7062 |
relinking even when the image file isn't out of date with respect |
| 7063 |
to the object files; these options effectively override the compiler's |
| 7064 |
normal dependency analysis for cases when the automatic analysis is |
| 7065 |
incorrect for some reason.) This change is gratuitous and cosmetic, |
| 7066 |
but makes the compiler's option names more closely resemble that of |
| 7067 |
traditional "make" programs. |
| 7068 |
|
| 7069 |
<li>Fixed a compiler bug: the compiler reported a spurious "symbol |
| 7070 |
already defined" warning when a particular grammar production had |
| 7071 |
rules defined in multiple modules. This has been corrected. |
| 7072 |
|
| 7073 |
<li>Fixed a preprocessor bug: if the argument of a #message was |
| 7074 |
missing its closing right parenthesis, the preprocessor got stuck |
| 7075 |
in an infinite loop. This has been corrected. |
| 7076 |
|
| 7077 |
<li>Fixed a bug in the <a href="sysman/vector.htm">Vector intrinsic |
| 7078 |
class</a> (and, by inheritance, in the Array intrinsic class): if the |
| 7079 |
<tt>insertAt</tt> method was called on an empty vector, a crash |
| 7080 |
occurred. This has been corrected. |
| 7081 |
|
| 7082 |
<li>Fixed a compiler bug that caused the compiler to crash if |
| 7083 |
confronted with a <tt>foreach</tt> statement in the absence of |
| 7084 |
the definition of the Collection and Iterator classes. This |
| 7085 |
has been corrected; the compiler now generates the appropriate |
| 7086 |
error message and recovers gracefully. |
| 7087 |
|
| 7088 |
<li>Fixed a problem with the grammar production object that caused |
| 7089 |
new match tree objects to bypass constructors on creation. The |
| 7090 |
match tree constructors are now invoked as for any other object |
| 7091 |
instantiation. |
| 7092 |
|
| 7093 |
<li>Fixed a problem in the debugger that prevented the debugger from |
| 7094 |
taking control on a run-time exception being thrown when another |
| 7095 |
run-time exception had previously occurred at the same place twice in |
| 7096 |
a row with no intervening debugger activity. |
| 7097 |
|
| 7098 |
<li>Fixed a problem that caused the debugger to crash under some |
| 7099 |
unusual conditions when an entry in the local-variables window |
| 7100 |
was selected and later automatically removed due to an execution |
| 7101 |
context change. |
| 7102 |
|
| 7103 |
<li>Improved the robustness of the debugger when the program |
| 7104 |
being debugged caused a stack-overflow exception. |
| 7105 |
|
| 7106 |
<li>Updated the calc.t example to the new GrammarProd.parseTokens() |
| 7107 |
interface. |
| 7108 |
|
| 7109 |
<li>Fixed a bug that caused comparisons of any two function pointers |
| 7110 |
to yield unequal, even for equivalent function pointers. This bug |
| 7111 |
had numerous subtle manifestations; for example, a function pointer |
| 7112 |
key in a LookupTable could never be found, since a test for equality |
| 7113 |
to the key would never succeed. |
| 7114 |
|
| 7115 |
<li>Fixed a compiler bug that caused the incorrect error message to |
| 7116 |
be reported when a replace/modify of an extern object was out of order |
| 7117 |
in a link (the message reported that a function rather than object |
| 7118 |
was involved). |
| 7119 |
|
| 7120 |
<li>Removed a spurious warning that was generated when a dictionary |
| 7121 |
was imported from multiple symbol files. |
| 7122 |
|
| 7123 |
<li class=last>Fixed a bug in the GrammarProd intrinsic class that caused "*" |
| 7124 |
tokens in subproductions to be misinterpreted. In the past, the "*" |
| 7125 |
token only worked properly in top-level productions (i.e., a production |
| 7126 |
on which parseTokens() was called); this has been corrected so that "*" |
| 7127 |
works properly at any level. |
| 7128 |
|
| 7129 |
</ul> |
| 7130 |
|
| 7131 |
|
| 7132 |
|
| 7133 |
<h3>Changes for 05/05/2001</h3> |
| 7134 |
|
| 7135 |
<ul> |
| 7136 |
|
| 7137 |
<li><b>Incompatible intrinsic class API change:</b> The return value |
| 7138 |
of the <tt>parseTokens()</tt> method in the <a |
| 7139 |
href="sysman/gramprod.htm">GrammarProd intrinsic class</a> has been changed. |
| 7140 |
In the past, this method returned a list, each of whose elements was |
| 7141 |
a sublist of two elements. Each sublist described one successful |
| 7142 |
match tree; the first element of each sublist was the number of |
| 7143 |
tokens matched, and the second was the root object of the match tree. |
| 7144 |
The 4/29/2001 version added the firstTokenIndex and lastTokenIndex |
| 7145 |
properties to the match objects; since the number of tokens matched |
| 7146 |
in a tree can be inferred from the firstTokenIndex and lastTokenIndex |
| 7147 |
values, the token counts in the return sublists were redundant. |
| 7148 |
Therefore, to simplify the API, the sublists have been eliminated, |
| 7149 |
and <tt>parseTokens()</tt> now returns simply a list of match tree |
| 7150 |
root objects. To obtain the token count for a match, simply calculate |
| 7151 |
<tt>(match.lastTokenIndex - match.firstTokenIndex - 1)</tt>, where |
| 7152 |
<tt>match</tt> is the root object in the match tree. Since the root |
| 7153 |
object in a tree encompasses the entire match, its token range |
| 7154 |
necessarily encompasses the range of tokens for the entire match. |
| 7155 |
|
| 7156 |
<li>Added <a href="sysman/preproc.htm">variable-argument macros</a>. |
| 7157 |
|
| 7158 |
<li>Fixed a problem in the <a href="sysman/gramprod.htm">GrammarProd intrinsic |
| 7159 |
class</a> that prevented a rule from being matched when it ended with |
| 7160 |
the special '*' token and was used as a subproduction in another rule. |
| 7161 |
This now works correctly. |
| 7162 |
|
| 7163 |
<li>Fixed a problem in the compiler that caused a spurious warning |
| 7164 |
message indicating that a dictionary symbol had been imported multiple |
| 7165 |
times. This warning was generated whenever the dictionary was declared |
| 7166 |
in more than one source file but not in <i>all</i> source files; each |
| 7167 |
file that did <i>not</i> declare the dictionary displayed the warning. |
| 7168 |
This has been corrected. |
| 7169 |
|
| 7170 |
<li>Added the <a href="sysman/expr.htm"><tt>delegated</tt> keyword</a>, |
| 7171 |
which allows delegating a method call to an unrelated object. |
| 7172 |
|
| 7173 |
<li>Added the <a href="sysman/tadsgen.htm"><tt>getMethodDefiner()</tt> |
| 7174 |
intrinsic function</a>, which returns the object that defines the currently |
| 7175 |
executing method. |
| 7176 |
|
| 7177 |
<li class=last>Changed the default name of the ASCII character set mapping to |
| 7178 |
"us-ascii" for better readability. The old name ("asc7dflt") is still |
| 7179 |
accepted, but is now obsolescent and should not be used in new code. |
| 7180 |
All of the #charset directives in the system headers provided with the |
| 7181 |
compiler have been updated to use the new "us-ascii" name. |
| 7182 |
|
| 7183 |
</ul> |
| 7184 |
|
| 7185 |
|
| 7186 |
<h3>Changes for 04/29/2001</h3> |
| 7187 |
|
| 7188 |
<ul> |
| 7189 |
|
| 7190 |
<li>Fixed a problem in the <a href="sysman/gramprod.htm">GrammarProd intrinsic |
| 7191 |
class</a> that caused incorrect results to be returned with |
| 7192 |
productions that matched exactly zero tokens. |
| 7193 |
|
| 7194 |
<li>Extended the <tt>grammar</tt> syntax to allow the "<tt>-></tt>" |
| 7195 |
notation to be used with literal tokens. In the past, the arrow was |
| 7196 |
only allowed with symbol-match tokens (subproductions and token classes), |
| 7197 |
but it is often desirable to be able to retrieve the matching token even |
| 7198 |
for a literal match. There are two cases in particular where a literal's |
| 7199 |
matching token is needed to reconstruct the original input: when the |
| 7200 |
literal is matched with truncation; and when a production has several |
| 7201 |
alternatives with different literals. |
| 7202 |
|
| 7203 |
<li>Modified the <a href="sysman/gramprod.htm">GrammarProd intrinsic class</a> |
| 7204 |
so that each match object now includes more direct information on the |
| 7205 |
tokens involved in the match. The parser now sets the |
| 7206 |
firstTokenIndex and lastTokenIndex properties of each match object to |
| 7207 |
indicate the index of the first token and of the last token, |
| 7208 |
respectively, that are involved in matching the rule corresponding to |
| 7209 |
the match object. This is a simple range, so all of the tokens from |
| 7210 |
the first to the last, inclusive, constitute the match's original |
| 7211 |
text. In addition, the parser sets the tokenList property of each |
| 7212 |
match tree item to the original token list passed into parseTokens() |
| 7213 |
(this doesn't take up nearly as much memory as it might at first |
| 7214 |
appear, since all of the match objects reference a single shared copy |
| 7215 |
of the token list). The exported properties firstTokenIndex, |
| 7216 |
lastTokenIndex, and tokenList are defined in gramprod.h. |
| 7217 |
|
| 7218 |
<li>The compiler now creates a dictionary entry in the default |
| 7219 |
dictionary, if one is defined, for each literal string that appears |
| 7220 |
in a <a href="sysman/gramprod.htm">"grammar"</a> statement's rule list. If no |
| 7221 |
default dictionary is defined when a "grammar" statement is |
| 7222 |
encountered, the statement's literals are not entered into any |
| 7223 |
dictionary. Each literal string is associated with the production |
| 7224 |
object and the property "miscVocab". Since these strings are now |
| 7225 |
stored in the dictionary, it is simple to determine if a word is |
| 7226 |
defined in any context; without the grammar literal dictionary |
| 7227 |
entries, it was not possible to determine if a given string, when |
| 7228 |
entered by a user at run-time, was known in the context of a grammar |
| 7229 |
literal. |
| 7230 |
|
| 7231 |
<li>The <a href="sysman/gramprod.htm">"grammar"</a> syntax has been extended |
| 7232 |
to allow a "tag" to be associated with each "grammar" statement. To |
| 7233 |
specify a tag, specify any symbol or number in parentheses after the |
| 7234 |
production name. For example: |
| 7235 |
|
| 7236 |
<p> |
| 7237 |
<pre> |
| 7238 |
grammar nounPhrase(1): adjective->adj_ : object ; |
| 7239 |
</pre> |
| 7240 |
|
| 7241 |
<p>The tag's only purpose is to provide an identifying name for the |
| 7242 |
new "grammarInfo" method, described below. |
| 7243 |
|
| 7244 |
<li>The compiler now automatically creates a method for each |
| 7245 |
<a href="sysman/gramprod.htm">grammar</a> match object that makes it possible to |
| 7246 |
traverse match trees without knowing their internal structure in |
| 7247 |
advance. The new method is called "grammarInfo," and it returns a |
| 7248 |
list. The list's first element is a string giving the name of the |
| 7249 |
production, with the optional tag (see above) enclosed in parentheses |
| 7250 |
after the production's symbolic name. Each subsequent element is the |
| 7251 |
value of a property appearing after an arrow ("->") in the production's |
| 7252 |
rule list. |
| 7253 |
|
| 7254 |
<li>Modified the <a href="sysman/gramprod.htm">grammar</a> production matching |
| 7255 |
algorithm so that [badness] matches are examined as a group rather |
| 7256 |
than individually. In particular, when a number of [badness] |
| 7257 |
alternatives arise simultaneously, the parser had in the past |
| 7258 |
examined only one such alternative at a time once determining that no |
| 7259 |
better matches were available. Now, all [badness] alternatives with |
| 7260 |
the lowest badness value are examined in parallel. This is important |
| 7261 |
in some cases for the same reasons that parallel consideration of |
| 7262 |
regular alternatives is necessary. |
| 7263 |
|
| 7264 |
<li>Fixed a compiler problem that caused spurious "variable assigned |
| 7265 |
but not used" warnings in certain situations. In particular, if a |
| 7266 |
local variable was defined in a nested scope within a method, and the |
| 7267 |
variable was used only within the lexical confines of an anonymous |
| 7268 |
function within the nested scope, the compiler did not correctly mark |
| 7269 |
the variable as having been used and thus incorrectly reported the |
| 7270 |
warning. This problem did not affect code generation; its only |
| 7271 |
effect was the unnecessary warning. |
| 7272 |
|
| 7273 |
<li>Enhanced the Dictionary intrinsic class's findWord() and |
| 7274 |
findWordTrunc() methods so that the property argument in each can be |
| 7275 |
omitted or specified as nil, in which case all objects with vocabulary |
| 7276 |
matching given text, for any part-of-speech property, will be |
| 7277 |
returned. |
| 7278 |
|
| 7279 |
<li class=last>Fixed a debugger problem that caused a crash in some obscure |
| 7280 |
cases involving opening a file during a debugger session when the |
| 7281 |
debugger had never taken control since the beginning of program |
| 7282 |
execution, and a similar problem that occurred when the VM threw |
| 7283 |
a run-time error exception under similar circumstances. |
| 7284 |
|
| 7285 |
</ul> |
| 7286 |
|
| 7287 |
|
| 7288 |
<h3>Changes for 04/15/2001</h3> |
| 7289 |
|
| 7290 |
<ul> |
| 7291 |
|
| 7292 |
<li>A new mechanism allows capturing calls to undefined methods and |
| 7293 |
properties. When a call is made to an undefined method, the VM now |
| 7294 |
calls a new property, <tt><a href="sysman/undef.htm">propNotDefined()</a></tt>, |
| 7295 |
on the target object. The new method receives as arguments the |
| 7296 |
the undefined property ID and the arguments to the original method |
| 7297 |
call. If <tt>propNotDefined</tt> is itself not defined, the VM |
| 7298 |
simply returns nil for the undefined method call, as it did in the |
| 7299 |
past. |
| 7300 |
|
| 7301 |
<li>Added some new <a href="sysman/regex.htm">regular expression</a> features: |
| 7302 |
<ul> |
| 7303 |
<li>Character classes can now be combined with '|', as in |
| 7304 |
<upper|digit> (matches any upper-case letter or any digit). |
| 7305 |
<li>Character classes can now be complemented with '^', as in |
| 7306 |
<^upper> (matches anything <i>except</i> upper-case letters). |
| 7307 |
<li>Added some <a href="sysman/regex.htm">named character |
| 7308 |
expressions</a>, which look similar to character-class expressions, |
| 7309 |
and which can be combined with character-class expressions via |
| 7310 |
'|': <upper|star> matches any upper-case letter or an asterisk. |
| 7311 |
</ul> |
| 7312 |
|
| 7313 |
<li class=last>Renamed the t23run.exe executable to simply tr32.exe, so the |
| 7314 |
combined TADS 2+3 interpreter is now the default interpreter. The |
| 7315 |
separate interpreters are now called t2r32.exe (for TADS 2) and |
| 7316 |
t3run.exe (for TADS 3). For the most part, users will not need to |
| 7317 |
run the version-specific interpreters at all; the only time these |
| 7318 |
should be needed is when bundling a game into an executable, in which |
| 7319 |
case it is desirable for the sake of minimizing file sizes to include |
| 7320 |
only the version of the interpreter actually needed. |
| 7321 |
|
| 7322 |
</ul> |
| 7323 |
|
| 7324 |
|
| 7325 |
<h3>Changes for 3/28/2001</h3> |
| 7326 |
|
| 7327 |
<ul> |
| 7328 |
|
| 7329 |
<li>The object definition syntax has been extended to allow an object's |
| 7330 |
property list to be enclosed in braces. Refer to the |
| 7331 |
<a href="sysman/objdef.htm">Object Definitions documentation</a> for details. |
| 7332 |
|
| 7333 |
<li>The object definition syntax now provides <a |
| 7334 |
href="sysman/objdef.htm">"nested" objects</a>. A nested object |
| 7335 |
is an anonymous object defined in-line within another object, with a |
| 7336 |
property of the enclosing object initialized with a reference to the |
| 7337 |
nested object; this syntax is convenient for defining certain types |
| 7338 |
of small helper objects. |
| 7339 |
|
| 7340 |
<li>The language now has a <a href="sysman/objdef.htm">static property |
| 7341 |
initialization</a> syntax, which allows a property to be initialized with |
| 7342 |
a non-constant value computed at compile-time. |
| 7343 |
|
| 7344 |
<li>Changed the behavior of the '+' property. The new behavior is |
| 7345 |
much simpler than the previous behavior: if an object is defined |
| 7346 |
with <i>N</i> plus signs, its '+' property is initialized to the |
| 7347 |
most recent object defined with <i>N</i>-1 plus signs. Explicitly |
| 7348 |
setting the '+' property in an object list is now irrelevant. |
| 7349 |
Refer to the <a href="sysman/objdef.htm">documentation</a> for details. |
| 7350 |
|
| 7351 |
<li>Changed the default filename suffix for image files to ".t3" (it |
| 7352 |
was formerly ".t3x") to make image filenames somewhat more friendly looking. |
| 7353 |
|
| 7354 |
<li>Added the new executable "t23run" - this is a 32-bit console-mode |
| 7355 |
combined TADS 2 and TADS 3 interpreter. You can use this single |
| 7356 |
application to run games compiled for TADS 2 or TADS 3. This version |
| 7357 |
of the interpreter is <i>not</i> designed for bundling single-file |
| 7358 |
games for distribution, since this would unnecessarily increase the |
| 7359 |
size of bundled games; use the appropriate single-version interpreter |
| 7360 |
executable for bundling. |
| 7361 |
|
| 7362 |
<li>Added the new executable "html23" - this is a combined TADS 2 and |
| 7363 |
TADS 3 version of the HTML interpreter. |
| 7364 |
|
| 7365 |
<li>For anyone interested in porting the combined command-line |
| 7366 |
interpreter on another platform, the code that implements this should |
| 7367 |
be easily portable to other command-line operating systems. See |
| 7368 |
the target 't23run.exe' in win32/makefile.vc5; you can find the source |
| 7369 |
code for the main program entrypoint in vmcl23.cpp. For systems that |
| 7370 |
don't use Unix-style command lines, the command line code itself won't |
| 7371 |
be portable, but portable code for sensing the engine version |
| 7372 |
needed to run a given game file can be found in vmmain.cpp. |
| 7373 |
|
| 7374 |
<li>Fixed a bug that caused problems with certain "reflection" |
| 7375 |
methods when the program used <tt>modify</tt> to extend the |
| 7376 |
<tt>TadsObject</tt> intrinsic class. If the program modified |
| 7377 |
<tt>TadsObject</tt>, then traversed the object tree (using the |
| 7378 |
<tt>getSuperclassList()</tt> method), or used the |
| 7379 |
<tt>propDefined()</tt> method, the behavior was incorrect, and could |
| 7380 |
lead to VM crashes. This has been corrected. |
| 7381 |
|
| 7382 |
<li>Added <a href="sysman/charmap.htm">documentation</a> on the <tt>#charset</tt> |
| 7383 |
directive and using source files encoded in Unicode UCS-2. |
| 7384 |
|
| 7385 |
<li>Added a <tt>#charset "asc7dflt"</tt> directive to each system |
| 7386 |
source and header file included with the compiler distribution. This |
| 7387 |
directive ensures that the compiler interprets the contents of the system |
| 7388 |
files correctly, in case the user wants to specify a default character |
| 7389 |
set for the compilation with the <tt>-cs</tt> compiler option. |
| 7390 |
|
| 7391 |
<li>The compiler now accepts Unicode character 0x2028 ("line |
| 7392 |
separator") as equivalent to a newline in source files that use of |
| 7393 |
the Unicode encodings the compiler accepts (UCS-2 big-endian, UCS-2 |
| 7394 |
little-endian, or UTF-8). |
| 7395 |
|
| 7396 |
<li class=last>In text mode, the <tt>fileRead()</tt> function now properly |
| 7397 |
translates input characters according to the character set selected |
| 7398 |
when the file was opened. (In the past, the character set was |
| 7399 |
ignored, and the characters from the file were not properly |
| 7400 |
translated to Unicode.) In addition, the <tt>fileRead()</tt> |
| 7401 |
function accepts Unicode character 0x2028 (the Unicode line separator |
| 7402 |
character) as equivalent to a newline (but note that, as always, the |
| 7403 |
text returned from <tt>readLine()</tt> represents each end-of-line |
| 7404 |
with a single '\n' character, regardless of the type of line |
| 7405 |
termination in the underlying file). |
| 7406 |
|
| 7407 |
</ul> |
| 7408 |
|
| 7409 |
|
| 7410 |
<h3>Changes for February 24, 2001</h3> |
| 7411 |
|
| 7412 |
<ul> |
| 7413 |
|
| 7414 |
<li>Added the <a href="sysman/t3vm.htm"><tt>t3AllocProp()</tt></a> |
| 7415 |
intrinsic function, which allocates a new property ID. |
| 7416 |
|
| 7417 |
<li>Added the <a href="sysman/objic.htm"> |
| 7418 |
<tt>Object.getPropList()</tt></a> |
| 7419 |
method, which returns a list of properties directly defined by an object. |
| 7420 |
|
| 7421 |
<li>Added the <a href="sysman/objic.htm"> |
| 7422 |
<tt>Object.getPropParams(<i>prop</i>)</tt></a> method, which returns |
| 7423 |
information on the parameters taken by a property or method. |
| 7424 |
|
| 7425 |
<li class=last>Added the <a href="sysman/tadsgen.htm"> |
| 7426 |
<tt>getFuncParams(<i>funcptr</i>)</tt></a> intrinsic function, which |
| 7427 |
returns information ont he parameters taken by a function. |
| 7428 |
|
| 7429 |
</ul> |
| 7430 |
|
| 7431 |
|
| 7432 |
<h3>Changes for February 10, 2001</h3> |
| 7433 |
|
| 7434 |
<ul> |
| 7435 |
|
| 7436 |
<li>The new <a href="sysman/proccode.htm"><tt>property</tt> statement</a> |
| 7437 |
allows a program to explicitly declare property symbols. This is optional, |
| 7438 |
but can be useful in certain cases in library code. |
| 7439 |
|
| 7440 |
<li>Added the <a href="sysman/lookup.htm">LookupTable intrinsic class</a>, |
| 7441 |
which implements a general-purpose associative array type. A LookupTable |
| 7442 |
is similar to a Vector, but whereas a Vector can use only integers as |
| 7443 |
indices, a Hashtable can use any value as an index. |
| 7444 |
|
| 7445 |
<li>Added the new <a href="sysman/reflect.htm"><tt>t3GetGlobalSymbols()</tt></a> |
| 7446 |
intrinsic function, which provides programmatic access to the |
| 7447 |
compile-time names of objects, properties, functions, intrinsic |
| 7448 |
classes, and enumerators. |
| 7449 |
|
| 7450 |
<li>The preprocessor now treats square brackets ("[ ]") and braces |
| 7451 |
("{ }") as grouping symbols when parsing macro arguments. In the past, |
| 7452 |
only parentheses were counted. This allows list constants and anonymous |
| 7453 |
functions to be used more easily as macro arguments. |
| 7454 |
|
| 7455 |
<li>In <tt>_main.t</tt>, added a new function, <tt>initAfterLoad()</tt>. |
| 7456 |
The main program entrypoint in <tt>_main.t</tt> (function <tt>_main()</tt>) |
| 7457 |
calls this new routine to perform initialization. This routine sets up |
| 7458 |
the default display function, performs pre-initialization if necessary, |
| 7459 |
then performs regular load-time initialization. All of these operations |
| 7460 |
were previously carried out in <tt>_main()</tt>; the reason they've been |
| 7461 |
separated into a new function is to allow the same operations to be called |
| 7462 |
after a <tt>restartGame</tt> operation. Since a <tt>restartGame</tt> |
| 7463 |
effectively re-loads the image file and starts the game over from |
| 7464 |
scratch, the same initialization that <tt>_main()</tt> |
| 7465 |
performs at initial load must be performed immediately after a restart; |
| 7466 |
this function makes this common code easy to re-use. |
| 7467 |
|
| 7468 |
<li>Added a new method to the TadsObject intrinsic class: |
| 7469 |
createInstance(), which creates an instance of the object. This |
| 7470 |
method passes its arguments to the new object's constructor, if any, |
| 7471 |
and returns a reference to the new object. |
| 7472 |
|
| 7473 |
<li>Added <tt>execAfterMe</tt> to <tt>ModuleExecObject</tt> in |
| 7474 |
<tt>_main.t</tt>. User code can initialize this property in a given |
| 7475 |
<tt>ModuleExecObject</tt> instance to contain a list of other |
| 7476 |
<tt>ModuleExecObject</tt> instances that are to be initialized |
| 7477 |
<b>after</b> the given instance; this is analogous to the |
| 7478 |
<tt>execBeforeMe</tt> list, but allows an object to specify things |
| 7479 |
that are to come after it. It is sometimes desirable to be able to |
| 7480 |
specify initialization order dependencies by specifying what must |
| 7481 |
follow rather than what must precede initialization of a given object, |
| 7482 |
and this new property provides the flexibility to specify order |
| 7483 |
dependencies either way. |
| 7484 |
|
| 7485 |
<li>A makefile for DJGPP (the definitive port of Gnu C/C++ for MS-DOS) |
| 7486 |
is now included in the source distribution. This makefile can be used |
| 7487 |
to create a 32-bit version of the interpreter that will run on MS-DOS |
| 7488 |
on PC's with 386 or later processors. |
| 7489 |
|
| 7490 |
<li>Fixed a VM problem that caused modification of the root intrinsic |
| 7491 |
object (i.e., <tt>modify Object</tt>) to fail. In the past, the VM |
| 7492 |
simply failed to execute code added to the root intrinsic object with |
| 7493 |
<tt>modify</tt>. This has been corrected; code added to |
| 7494 |
<tt>Object</tt> is now properly inherited from the other intrinsic |
| 7495 |
classes. |
| 7496 |
|
| 7497 |
<li>The String and List intrinsic classes can now be extended with |
| 7498 |
the <tt>modify</tt> mechanism. In the past, the VM did not correctly |
| 7499 |
handle code extensions to the String and List intrinsic classes. |
| 7500 |
|
| 7501 |
<li>Fixed a compiler bug that caused incorrect code generation |
| 7502 |
when adding a constant zero value to a local variable which, at run-time, |
| 7503 |
ends up containing a vector, list, or other non-integer value. |
| 7504 |
|
| 7505 |
<li>The Vector intrinsic class can now be used with the <tt>foreach</tt> |
| 7506 |
keyword to loop over the elements in a vector. (In previous versions, |
| 7507 |
the Vector class incorrectly omitted support for <tt>foreach</tt>.) |
| 7508 |
|
| 7509 |
<li>The "Frames" version of the documentation should now work |
| 7510 |
correctly with Netscape and other browsers that had trouble with past |
| 7511 |
versions. (The frames page had some ill-formed HTML, which some |
| 7512 |
browsers rejected, but this page has now been corrected.) |
| 7513 |
|
| 7514 |
<li>Changed the text of the VM error message that results from |
| 7515 |
applying an index to a type that cannot be indexed (nil[3], for |
| 7516 |
example). In the past, the message read "invalid type for indexing - |
| 7517 |
value cannot be index," which incorrectly signified that there was |
| 7518 |
something wrong with the index value, when in fact the value being |
| 7519 |
indexed was the problem. The message has been changed to read |
| 7520 |
"invalid index operation - this type of value cannot be indexed." |
| 7521 |
|
| 7522 |
<li>Fixed a problem in the Vector intrinsic class that caused |
| 7523 |
a vector's data to be corrupted by certain operations that should have, |
| 7524 |
but did not, increase the internal storage space allocated for the |
| 7525 |
Vector object. |
| 7526 |
|
| 7527 |
<li>Fixed a compiler problem with object templates. The compiler |
| 7528 |
did not properly parse object templates that included list tokens; |
| 7529 |
this has been corrected. |
| 7530 |
|
| 7531 |
<li>Fixed a bug in the <tt>rand()</tt> intrinsic function. In the |
| 7532 |
past, this function crashed the interpreter if the argument was a |
| 7533 |
list with no elements. This has been corrected; the function now |
| 7534 |
returns <tt>nil</tt> when the argument is a list with no elements. |
| 7535 |
|
| 7536 |
<li>Fixed a problem with the <tt>Vector</tt> intrinsic class that |
| 7537 |
caused pre-initialized data to be loaded incorrectly. |
| 7538 |
|
| 7539 |
<li>Corrected the documentation (the <a href="sysman/expr.htm">expressions |
| 7540 |
chapter</a>) to reflect the correct precedence of the "<tt>[]</tt>" and |
| 7541 |
"<tt>.</tt>" operators, which should be above the unary operators. |
| 7542 |
|
| 7543 |
<li>Added four new methods to the <a href="sysman/list.htm">List intrinsic |
| 7544 |
class</a>: <tt>prepend(<i>val</i>)</tt>, which inserts a new value at |
| 7545 |
the start of a list; <tt>insertAt(<i>index, val1, val2, ...</i>)</tt>, |
| 7546 |
which inserts one or more values into a list at a given position; |
| 7547 |
<tt>removeElementAt(<i>index</i>)</tt>, which deletes the element |
| 7548 |
at the given index; and <tt>removeRange(<i>startIndex, endIndex</i>)</tt>, |
| 7549 |
which removes the elements in the given range of indices. |
| 7550 |
|
| 7551 |
<li>Added a new method to the <a href="sysman/vector.htm">Vector intrinsic |
| 7552 |
class</a>: <tt>prepend(<i>val</i>)</tt>, which inserts a new value at |
| 7553 |
the start of a vector. |
| 7554 |
|
| 7555 |
<li>It is no longer legal to apply the unary "<tt>&</tt>" |
| 7556 |
operator to an object symbol. In the past, |
| 7557 |
"<tt>&<i>objectName</i></tt>" was the same as simply |
| 7558 |
"<tt><i>objectName</i></tt>"; this is no longer legal. |
| 7559 |
"<tt>&<i>objectName</i></tt>" was never a meaningful construct, |
| 7560 |
since an object symbol yields a reference to the object to begin |
| 7561 |
with, but past versions of the compiler accepted it without complaint |
| 7562 |
and treated it as equivalent to the unadorned object symbol; the |
| 7563 |
compiler now rejects this construct. |
| 7564 |
|
| 7565 |
<li>It is no longer legal to apply the unary "<tt>&</tt>" |
| 7566 |
operator to a function name symbol. In the past, |
| 7567 |
"<tt>&<i>functionName</i></tt>" yielded a reference to the |
| 7568 |
function. This has been changed so that the function name used |
| 7569 |
by itself yields a reference to the function, just as an object |
| 7570 |
name does. |
| 7571 |
|
| 7572 |
<li>Because the "<tt>&</tt>" operator can no longer be used with |
| 7573 |
any symbol types other than properties, there is no longer a warning |
| 7574 |
when using the operator with an otherwise undefined symbol name. |
| 7575 |
"<tt>&<i>symbol</i></tt>" now unambiguously defines the symbol |
| 7576 |
as a property name. |
| 7577 |
|
| 7578 |
<li class=last>Fixed a compiler bug that caused a spurious warning message when |
| 7579 |
compiling certain types of expressions involving property pointers. |
| 7580 |
The warning did not affect code generation, but it was incorrect and |
| 7581 |
has been removed. |
| 7582 |
|
| 7583 |
</ul> |
| 7584 |
|
| 7585 |
|
| 7586 |
<h3>Changes for version 3.0.2 (September 27, 2000)</h3> |
| 7587 |
|
| 7588 |
<ul> |
| 7589 |
|
| 7590 |
<li>Fixed a compiler problem that caused the compiler to go into an |
| 7591 |
infinite loop (and therefore freeze up) when confronted with a 'switch' |
| 7592 |
statement containing code before the first 'case' or 'default' label. |
| 7593 |
This has been corrected; the compiler now reports an error (such code |
| 7594 |
is unreachable) and continues with the compilation. |
| 7595 |
|
| 7596 |
<li class=last>Fixed a minor compiler problem that generated a spurious warning |
| 7597 |
message in a certain situation. Specifically, if none of a 'switch' |
| 7598 |
statement's 'case' labels led to code paths that could reach the next |
| 7599 |
statement after the 'switch' (for example, if every code path |
| 7600 |
reachable from a 'case' label led to a 'return' statement), but the |
| 7601 |
'switch' had no 'default' label, the compiler generated the warning |
| 7602 |
message "unreachable statement" at the next executable statement |
| 7603 |
after the 'switch'. This warning was incorrect because, in most |
| 7604 |
cases, it is not safe to assume that every possible value of a |
| 7605 |
switch's controlling expression is included in the list of explicit |
| 7606 |
cases, hence the next statement following a 'switch' with no |
| 7607 |
'default' is reachable any time the controlling expression's value is |
| 7608 |
not in the list of explicit 'case' labels. Note that this problem |
| 7609 |
merely caused the spurious warning and did not affect code |
| 7610 |
generation. |
| 7611 |
|
| 7612 |
</ul> |
| 7613 |
|
| 7614 |
|
| 7615 |
<h3>Changes for June 24, 2000</h3> |
| 7616 |
|
| 7617 |
<ul> |
| 7618 |
|
| 7619 |
<li class=last>Fixed a compiler problem with try/catch statements. The compiler |
| 7620 |
did not correctly generate handlers for any catch block past the |
| 7621 |
first for a given try statement; this has been corrected. |
| 7622 |
|
| 7623 |
</ul> |
| 7624 |
|
| 7625 |
|
| 7626 |
<h3>Changes for version 3.0.1 (June 17, 2000)</h3> |
| 7627 |
|
| 7628 |
<ul> |
| 7629 |
|
| 7630 |
<li class=last>The meaning of the syntax <tt>x.y</tt> and <tt>&y</tt> have |
| 7631 |
changed slightly, in a way that will be transparent to most code. |
| 7632 |
In the past, if <tt>y</tt> was a local variable, then <tt>x.y</tt> |
| 7633 |
evaluated the local, then called the method on <tt>x</tt> specified |
| 7634 |
by the property pointer value in the local; <tt>&y</tt> simply |
| 7635 |
generated a compilation error because a local's address cannot be |
| 7636 |
evaluated. This behavior has changed. Now, <tt>x.y</tt> and |
| 7637 |
<tt>&y</tt> both ignore the local definition of <tt>y</tt> and |
| 7638 |
interpreter <tt>y</tt> as a property name. This change is important |
| 7639 |
because it allows code to refer to a property explicitly, even when |
| 7640 |
a local of the same name has been defined in the code block. For |
| 7641 |
example: |
| 7642 |
|
| 7643 |
<p> |
| 7644 |
<pre> |
| 7645 |
myObject: object |
| 7646 |
obj = nil |
| 7647 |
setObj(obj) { self.obj = obj; } |
| 7648 |
; |
| 7649 |
</pre> |
| 7650 |
<p> |
| 7651 |
In the past, the code above would have had to use a different name |
| 7652 |
for the formal parameter variable <tt>obj</tt>, because it would not |
| 7653 |
have been able to refer to the property of the same name. With the |
| 7654 |
new interpretation, the code can distinguish between the local and |
| 7655 |
the property by referring to the property explicitly using <tt>self.obj</tt>. |
| 7656 |
|
| 7657 |
<p>Note that it is still simple to obtain the old behavior of |
| 7658 |
evaluating the local variable and calling a method via the resulting |
| 7659 |
property pointer. To do this, simply enclose the local in |
| 7660 |
parentheses: <tt>x.(y)</tt>. |
| 7661 |
|
| 7662 |
</ul> |
| 7663 |
|
| 7664 |
|
| 7665 |
<h3>Changes for 5/21/2000</h3> |
| 7666 |
|
| 7667 |
<ul> |
| 7668 |
|
| 7669 |
<li>Add a new <a href="sysman/vector.htm">Vector</a> intrinsic class, a subclass |
| 7670 |
of Array that combines the reference semantics of an Array with the |
| 7671 |
dynamic sizing capabilities of a List. Vector is substantially more |
| 7672 |
efficient than List when constructing a collection iteratively. |
| 7673 |
|
| 7674 |
<li>Added some new List methods: |
| 7675 |
<a href="sysman/list.htm">sort</a>, |
| 7676 |
<a href="sysman/list.htm">append</a>, |
| 7677 |
<a href="sysman/list.htm">appendUnique</a>. |
| 7678 |
|
| 7679 |
<li>Added new Array methods: sort, appendUnique. |
| 7680 |
|
| 7681 |
<li>Added an <a href="sysman/errtrans.htm">error message translation |
| 7682 |
mechanism</a>, which allows non-English versions of the interpreter's |
| 7683 |
and compiler's error messages to be substituted at run-time. |
| 7684 |
Messages can be loaded from an external file, so there is no need to |
| 7685 |
recompile the system to switch languages. (At the moment, of course, |
| 7686 |
only an English set of messages actually comes with the system, but |
| 7687 |
it is hoped that a few translated versions will be contributed so |
| 7688 |
that more languages will be supported "out of the box" in the future.) |
| 7689 |
|
| 7690 |
<li class=last>Fixed a bug that reversed the order of arguments in calls to |
| 7691 |
anonymous functions while running in the debugger. |
| 7692 |
|
| 7693 |
</ul> |
| 7694 |
|
| 7695 |
|
| 7696 |
<h3>Changes for 5/11/2000</h3> |
| 7697 |
|
| 7698 |
<ul> |
| 7699 |
|
| 7700 |
<li>Changed the name of the <tt>say</tt> function in the "tads-io" |
| 7701 |
intrinsic function set to <a |
| 7702 |
href="sysman/tadsio.htm"><tt>tadsSay</tt></a>. This allows the |
| 7703 |
library to define its own higher-level function called <tt>say</tt>; |
| 7704 |
since user code should almost always call the library's function |
| 7705 |
rather than the low-level direct console output function, it is |
| 7706 |
desirable to give the library version the shorter, more convenient |
| 7707 |
name. |
| 7708 |
|
| 7709 |
<li class=last>Added the <tt>appendUnique()</tt> method to the <a |
| 7710 |
href="sysman/list.htm">List</a> and Array intrinsic classes. |
| 7711 |
|
| 7712 |
</ul> |
| 7713 |
|
| 7714 |
|
| 7715 |
<h3>Changes for 4/24/2000</h3> |
| 7716 |
|
| 7717 |
<ul> |
| 7718 |
|
| 7719 |
<li class=last>Fixed a bug in the compiler that caused lost properties on objects |
| 7720 |
under certain very complicated circumstances (the problem occurred when |
| 7721 |
dictionaries and other objects were defined in a particular order). |
| 7722 |
|
| 7723 |
</ul> |
| 7724 |
|
| 7725 |
|
| 7726 |
<h3>Changes for 4/22/2000</h3> |
| 7727 |
|
| 7728 |
<ul> |
| 7729 |
|
| 7730 |
<li>Added the <a href="sysman/proccode.htm"><tt>foreach</tt> statement</a>. |
| 7731 |
|
| 7732 |
<li>Added the <a href="sysman/collect.htm">Collection</a> and <a |
| 7733 |
href="sysman/iter.htm"> Iterator</a> classes. <a |
| 7734 |
href="sysman/list.htm">List</a> and Array are now subclasses of |
| 7735 |
Collection, so these classes can create Iterator objects to visit |
| 7736 |
their elements. |
| 7737 |
|
| 7738 |
<li class=last>The Windows HTML interpreter now supports PNG transparency (this is |
| 7739 |
a generic change to the Windows HTML renderer that will also be in |
| 7740 |
HTML TADS 2.5.4). Note that only simple transparency is supported; |
| 7741 |
full alpha blending is still not supported. PNG transparency now has |
| 7742 |
its own systemInfo() capability code, SYSINFO_PNG_TRANS. |
| 7743 |
|
| 7744 |
</ul> |
| 7745 |
|
| 7746 |
|
| 7747 |
<h3>Changes for 4/16/2000</h3> |
| 7748 |
|
| 7749 |
<ul> |
| 7750 |
|
| 7751 |
<li>Fixed a bug that caused a compiler crash when a source |
| 7752 |
file was completely empty (or contained only comments). |
| 7753 |
|
| 7754 |
<li class=last>Fixed a bug that caused a compiler crash in certain situations |
| 7755 |
involving multiple initializers in a single 'local' statement. |
| 7756 |
|
| 7757 |
</ul> |
| 7758 |
|
| 7759 |
|
| 7760 |
<h3>Changes since 3.0.0</h3> |
| 7761 |
|
| 7762 |
<ul> |
| 7763 |
|
| 7764 |
<li>Added the <a href="sysman/string.htm">htmlify()</a> method to the |
| 7765 |
String class. This method converts any HTML markup-significant characters |
| 7766 |
in the string to their HTML equivalents; in particular, it converts |
| 7767 |
an ampersand ("&") to "&amp;" and a less-than sign ("<") |
| 7768 |
to "&lt;", and can also optionally quote spaces, tabs, and newlines |
| 7769 |
to ensure display fidelity for these whitespace characters as well. |
| 7770 |
|
| 7771 |
<li>Added a <a href="sysman/regex.htm"> |
| 7772 |
shortest-match modifier</a> to the regular expression closure |
| 7773 |
operators ("*", "+", and "?"). This feature provides precise control |
| 7774 |
over how matches are allocated in expressions involving multiple |
| 7775 |
closures. |
| 7776 |
|
| 7777 |
<li>Added the <a href="sysman/regex.htm">non-capturing |
| 7778 |
modifier</a> to the regular expression group syntax; this allows a |
| 7779 |
parenthesized group to be omitted from the counted groups. |
| 7780 |
|
| 7781 |
<li>Added <a |
| 7782 |
href="sysman/regex.htm">look-ahead assertions</a> to |
| 7783 |
the regular expression syntax. |
| 7784 |
|
| 7785 |
<li>Added the regular expression <a |
| 7786 |
href="sysman/regex.htm">interval operator</a>, which provides a |
| 7787 |
compact notation for specifying a specific number of repetitions of a |
| 7788 |
sub-expression. |
| 7789 |
|
| 7790 |
<li>Renamed a few <a href="sysman/list.htm">list methods</a> and array |
| 7791 |
methods, and expanded both sets for greater consistency and more |
| 7792 |
complete functionality: |
| 7793 |
|
| 7794 |
<ul> |
| 7795 |
<li>indexOf |
| 7796 |
<li>indexWhich |
| 7797 |
<li>valWhich |
| 7798 |
<li>lastIndexOf |
| 7799 |
<li>lastIndexWhich |
| 7800 |
<li>lastValWhich |
| 7801 |
<li>countOf |
| 7802 |
<li>countWhich |
| 7803 |
<li>mapAll |
| 7804 |
<li>applyAll (arrays only) |
| 7805 |
<li>forEach |
| 7806 |
<li>getUnique |
| 7807 |
</ul> |
| 7808 |
|
| 7809 |
<li>When the default start-up module (_main.t) is automatically included |
| 7810 |
in a build, _main.t is linked in first. It was formerly linked in last, |
| 7811 |
which didn't allow 'modify' or 'replace' to be used with objects defined |
| 7812 |
in the module. |
| 7813 |
|
| 7814 |
<li>When running under the debugger, RuntimeError exceptions now |
| 7815 |
include stack trace information (with source line information) in the |
| 7816 |
exceptionMessage string associated with the exception object. This |
| 7817 |
makes it easier to track down where a run-time error occurred. Note |
| 7818 |
that this information is available only when running under the debugger, |
| 7819 |
because this is the only time the system has access to the necessary |
| 7820 |
source line information. |
| 7821 |
|
| 7822 |
<li>Added a "character map library" mechanism to the |
| 7823 |
<a href="sysman/alone.htm">stand-alone interpreter</a>. This new feature |
| 7824 |
allows a set of character map (.tcm) files to be bundled with a |
| 7825 |
stand-alone game, eliminating the need to distribute separate .tcm files |
| 7826 |
with a stand-alone game. (Having to distribute .tcm files seemed to |
| 7827 |
defeat the purpose of building a stand-alone executable. The new |
| 7828 |
bundling feature still allows users with localizations that aren't |
| 7829 |
included in the standard character map set to add their own .tcm files, |
| 7830 |
but it makes character mappings entirely invisible for most users.) |
| 7831 |
|
| 7832 |
<li class=last>Added CP1250.TCM (a character set mapping for the Windows |
| 7833 |
Eastern/Central European code page), CP850.TCM (DOS OEM Latin 1), |
| 7834 |
and CP852.TCM (DOS OEM Latin 2) to the default character map set |
| 7835 |
for Windows. |
| 7836 |
|
| 7837 |
</ul> |
| 7838 |
|
| 7839 |
|
| 7840 |
|
| 7841 |
<h3>Changes since 03/30/2000</h3> |
| 7842 |
|
| 7843 |
<ul> |
| 7844 |
|
| 7845 |
<li>Slightly changed the <tt>InitObject</tt> mechanism. The class |
| 7846 |
formerly known as <tt>InitObject</tt> is now called |
| 7847 |
<tt>PreinitObject</tt>, and a new class <tt>InitObject</tt> has been |
| 7848 |
added. The new <tt>InitObject</tt> does the same thing that |
| 7849 |
<tt>PreinitObject</tt> does, but does it at regular program start-up |
| 7850 |
rather than pre-initialization. This change makes the |
| 7851 |
pre-initialization and regular initialization mechanisms work the |
| 7852 |
same way. In addition, to make this mechanism more generic, both |
| 7853 |
<tt>InitObject</tt> and <tt>PreinitObject</tt> now descend from a |
| 7854 |
base class called <tt>ModuleExecObject</tt>; this class should be |
| 7855 |
usable as the base class for other types of modular execution |
| 7856 |
objects, such as perhaps a post-restore initializer sequence, a |
| 7857 |
command parsing initializer sequence, and so on. Refer to the |
| 7858 |
<a href="sysman/init.htm">library pre-initialization</a> documentation for |
| 7859 |
details. |
| 7860 |
|
| 7861 |
<li>Added the <tt>-r</tt> option to the interpreter, allowing games to |
| 7862 |
be restored directly from the command. The saved state files now include |
| 7863 |
information on the image file that created them, so if you're restoring |
| 7864 |
a game, you don't have to specify the image file; this particular feature |
| 7865 |
also allows double-clicking on a saved state from the desktop to start |
| 7866 |
the interpreter, load the image file, and restore the saved state. |
| 7867 |
|
| 7868 |
<li class=last>The GrammarProd intrinsic class's parseTokens() method now |
| 7869 |
includes truncated matches to dictionary words (according to the |
| 7870 |
dictionary's truncation length setting) in its structural analysis. |
| 7871 |
The method also includes truncated matches (again, using the dictionary |
| 7872 |
setting) for literal tokens in the grammar. If you don't want to allow |
| 7873 |
truncated matches, simply change the dictionary's truncation length |
| 7874 |
setting to zero. |
| 7875 |
|
| 7876 |
</ul> |
| 7877 |
|
| 7878 |
|
| 7879 |
<h3>Changes since 03/26/2000</h3> |
| 7880 |
|
| 7881 |
<ul> |
| 7882 |
|
| 7883 |
<li>Added a new <a href="sysman/init.htm">library pre-initialization</a> |
| 7884 |
mechanism based on "initialization objects" rather than a simple |
| 7885 |
preinit() method. This new mechanism should be especially useful for |
| 7886 |
library developers, since new initialization objects can be plugged in |
| 7887 |
without touching any library or user code |
| 7888 |
|
| 7889 |
<li class=last>It is now possible to <a href='t3icext.htm'>extend |
| 7890 |
intrinsic classes</a> with user-defined methods. |
| 7891 |
|
| 7892 |
</ul> |
| 7893 |
|
| 7894 |
|
| 7895 |
<h3>Changes since 03/21/2000</h3> |
| 7896 |
|
| 7897 |
<ul> |
| 7898 |
|
| 7899 |
<li>The method-based API to certain functions that were formerly |
| 7900 |
implemented as intrinsics is now official. The trailing underscores |
| 7901 |
on the interim method names have been removed, and the corresponding |
| 7902 |
functions have been removed from the intrinsic function sets. |
| 7903 |
|
| 7904 |
<ul> |
| 7905 |
<li>getSuperclassList() is now Object.getSuperclassList() |
| 7906 |
<li>isClass() is now Object.isClass() |
| 7907 |
<li>propDefined() is now Object.propDefined() |
| 7908 |
<li>propType() is now Object.propType() |
| 7909 |
<li>length() is now List.length() and String.length() |
| 7910 |
<li>sublist() is now List.sublist() |
| 7911 |
<li>intersect() is now List.intersect() |
| 7912 |
<li>car() and cdr() are now List.car() and List.cdr() |
| 7913 |
<li>substr() is now String.substr() |
| 7914 |
<li>toUpper() is now String.toUpper() |
| 7915 |
<li>toLower() is now String.toLower() |
| 7916 |
<li>find() is now List.find() and String.find() |
| 7917 |
<li>toUnicode() is now String.toUnicode() |
| 7918 |
</ul> |
| 7919 |
|
| 7920 |
This change will, of course, necessitate recompiling all code, and will |
| 7921 |
require changing code that calls any of the functions that have been |
| 7922 |
migrated to methods. The sample code included in the distribution has |
| 7923 |
been updated to reflect the changes, and the documentation has also been |
| 7924 |
updated. |
| 7925 |
|
| 7926 |
<li>Renamed the <tt>getSize()</tt> method in the Array class to |
| 7927 |
<tt>length()</tt>, for consistency with List and String. |
| 7928 |
|
| 7929 |
<li>Added the 'is in' and 'not in' operators. See |
| 7930 |
the <a href="sysman/expr.htm">"is in" and "not in" expressions</a> |
| 7931 |
section. |
| 7932 |
|
| 7933 |
<li>The debugger now has "program arguments" settings. You can |
| 7934 |
access these settings via a dialog, which you can open using the |
| 7935 |
"Program Arguments" item on the "Debug" menu. You can use the |
| 7936 |
program arguments to control script file reading, output logging, |
| 7937 |
and the argument string that is passed to your program's "_main()" |
| 7938 |
entrypoint procedure. |
| 7939 |
|
| 7940 |
<li>Added several new regular expression features: <Case> and |
| 7941 |
<NoCase>, <Alpha>, <Upper>, <Lower>, <Digit>, |
| 7942 |
<AlphaNum>, <Space>, <Punct>. Refer to the new |
| 7943 |
<a href="sysman/regex.htm">regular expressions section</a> of the documentation |
| 7944 |
for details. |
| 7945 |
|
| 7946 |
<li>Enhanced the regular expression parser to detect and remove |
| 7947 |
cycles in compiled patterns. It is possible (pretty easy, |
| 7948 |
actually) to introduce "infinite loops" into a pattern; the easiest |
| 7949 |
way to do this is to put a zero-or-more closure inside another closure, |
| 7950 |
as in "(.*)+" (this has an infinite loop because the expression in |
| 7951 |
parentheses can match zero characters, and that match can be repeated any |
| 7952 |
number of times), but much more complex and subtle types of cycles are |
| 7953 |
possible and can be inadvertantly constructed. Eliminating the |
| 7954 |
infinitely repeating zero-length matches obviously doesn't change the |
| 7955 |
meaning of the expression, since one repetition of a zero-length match is |
| 7956 |
as good as a million, so the regular expression matcher simply detects |
| 7957 |
and removes these loops and then carries on as normal. |
| 7958 |
|
| 7959 |
<li>Updated StartI3.t and StartA3.t (the starter games in the Workbench |
| 7960 |
kit) to work with _main.t, so you don't have to compile them with -nodef. |
| 7961 |
(This also has the benefit of making the files a whole lot simpler.) |
| 7962 |
Also updated them to use method calls rather than intrinsic function |
| 7963 |
calls where appropriate. |
| 7964 |
|
| 7965 |
<li class=last>Updated the sample files to use the standard _main.t startup and |
| 7966 |
new property functions. |
| 7967 |
|
| 7968 |
</ul> |
| 7969 |
|
| 7970 |
|
| 7971 |
<h3>Changes since 03/12/2000</h3> |
| 7972 |
|
| 7973 |
<ul> |
| 7974 |
|
| 7975 |
<li>Added <a href='t3dispfn.htm'>default display methods</a>, which |
| 7976 |
allow string display to be routed through a method of the active |
| 7977 |
"self" object in effect each time a string is displayed and each time |
| 7978 |
an expression embedded in a string via the << >> syntax |
| 7979 |
is displayed. This powerful new feature allows for per-object output |
| 7980 |
filtering, and allows for "stateful" filtering (in that the filtering |
| 7981 |
function is a method of the object that initiated the filtering, and |
| 7982 |
can therefore look at properties of "self" to perform its work). |
| 7983 |
|
| 7984 |
<li>Added the <a href='t3anonfn.htm#shortForm'>"short form" anonymous |
| 7985 |
function</a> syntax, which is much |
| 7986 |
more compact than the long form, but can only be used to define |
| 7987 |
functions that consist solely of a single expression. |
| 7988 |
|
| 7989 |
<li>Added the <tt>subset()</tt> and <tt>applyAll()</tt> methods to |
| 7990 |
the <a href='t3array.htm'>array</a> and <a href="sysman/list.htm">list</a> |
| 7991 |
intrinsic classes. |
| 7992 |
|
| 7993 |
<li>Added <a href="sysman/list.htm">documentation for the List intrinsic |
| 7994 |
class</a>. |
| 7995 |
|
| 7996 |
<li>Added the <tt>-cs</tt> interpreter option, which allows the user |
| 7997 |
to specify a character set to use for the display and keyboard. |
| 7998 |
Refer to the new <a href='t3run.htm'>interpreter section</a> in |
| 7999 |
the documentation. |
| 8000 |
|
| 8001 |
<li>As mentioned above, there is a <a href='t3run.htm'>new section |
| 8002 |
on the interpreter</a> in the documentation. |
| 8003 |
|
| 8004 |
<li>The TADS 3 HTML interpreter and debugger for Windows now use a |
| 8005 |
separate registry key for storing their preference settings. In |
| 8006 |
addition, the TADS 3 debugger's global preferences file is now |
| 8007 |
called HTMLTDB3.TDC. These changes should allow TADS 2 and TADS 3 |
| 8008 |
installations to co-exist independently on a single system, without |
| 8009 |
affecting one another's stored configuration settings. |
| 8010 |
|
| 8011 |
<li>Anonymous function objects are now represented by their own |
| 8012 |
intrinsic class. This is a mostly internal change, but does have |
| 8013 |
the benefit of enabling the debugger to display the type of an |
| 8014 |
anonymous function object (before, the debugger only knew that they |
| 8015 |
were objects). |
| 8016 |
|
| 8017 |
<li>Made some internal changes to the way anonymous function context |
| 8018 |
objects are implemented to make them more efficient. (In particular, |
| 8019 |
context objects are now arrays, not TADS objects; array index lookup |
| 8020 |
is faster than TADS object property lookup.) |
| 8021 |
|
| 8022 |
<li>Moved the code to Visual C++ 6 (which involved no changes, not |
| 8023 |
surprisingly, although the new C++ compiler caught a few dubious |
| 8024 |
constructs and generated helpful warnings, all of which have been |
| 8025 |
cleaned up). |
| 8026 |
|
| 8027 |
</ul> |
| 8028 |
|
| 8029 |
|
| 8030 |
</body> |
| 8031 |
</html> |
| 8032 |
|