Because we’re limited to unsigned integers (BTW, please please please at least let us have signed integers someday!), and things like tangents and square roots are Right Out, I’m having to use lookup tables to enable a part of a game that involves ranges and bearings. So I’ve got this:
…which is taking up 200 bytes worth of dynamic memory, but it isn’t actually a variable, and should be able to sit in static memory. (And would do, if I were writing this in ZIL.)
If I drop the “global variable” bit and do
(bearings table [[45 63 ...] ... [ ... 42 45]])
that would be a predicate with one parameter, which becomes a per-object flag, and the list isn’t an object, so that should barf.
well, I’m actually a Naval Historian, and coding this type of thing is part and parcel of my research, but I use proper languages (C, Fortran, Pascal, and for those frequent quick’n dirty work, python, perl, even old interpreted basic) and not IF languages.
If you’re writing a parser-based Naval IF, count me as potential ßtester… at your risk ! )
…actually works. Which, I guess, makes sense, since the third pattern should unify to the second. (It’s taking me a little while to start to wrap my head around what’s going on under the covers.) So is that the recommended pattern for declaring static data, then?
And now that I’ve filled out the table to 20x20, I get
Error: trek.dg, line 251: Rule too complex. Try breaking it into smaller parts.
…but it worked just fine when the table was partially filled out with zeroes. Is there some hard-coded limit that I’m exceeding? Reintroducing the third pattern of
I came across this thread again while poking at this issue. If the compiler can handle the huge list of lists in a rule body, just not in a rule head, then I agree this is an outright bug—there’s no reason one of them should need more temporary space than the other. Ideally literals would be compiled the same way in both cases.
So, five years later, enjoy this reassurance that this issue will hopefully be fixed in 1c/01!