[I6] Bocfel and the abbreviation 'x//' equal to 0


#1

It’s hard to explain what’s going on with Bocfel and abbreviation ‘x//’:
If the grammar is verb ‘x//’ * -> Examine or verb ‘x//’ ‘exam’ * -> Examine, and I input >x:
DicWord(1), return 0 (what is wrong!)
But if the grammar is verb ‘x//’ ‘examine’ * -> Examine, and I input >x:
DicWord(1), return a value greater than 0.
Under Frotz (David Griffith) or WindowsFrotz, all works fine, the value is always greater than 0.

[code]Constant INPUT_BUFFER_LEN = WORDSIZE + 16;
Constant MAX_BUFFER_WORDS = 1;

Array buffer -> INPUT_BUFFER_LEN + 1;
Array parse buffer (MAX_BUFFER_WORDS * 4) + 3;

[ DicWord w; return parse–>(w * 2 - 1); ];
[ NumWord; return parse->1; ];

[ Main w;
buffer->0 = INPUT_BUFFER_LEN - WORDSIZE;
parse->0 = MAX_BUFFER_WORDS;
while(1) {
.FreshInput;
print “^>”;
read buffer parse;
if ( NumWord() == 0 )
jump FreshInput;
w = DicWord(1);
if (w && w == ‘quit’) break;
print w,"^";
}
];

[ ExamineSub; ];
!verb ‘x//’ * -> Examine;
verb ‘x//’ ‘exam’ * -> Examine;
!verb ‘x//’ ‘examine’ * -> Examine;[/code]verb ‘x//’ ‘exam’ * -> Examine:

verb ‘x//’ ‘examine’ * -> Examine:

‘x’ is greater than 0 but equal to ‘examine’ (which is not the case with other interpreters!?)
Can anyone try to reproduce these mistakes?


#2

You can try with library. Just remove or rename, in grammar.h, ‘examine’ to ‘exam’:[code]!% +Language_name=english
Include “parser”;
Include “verblib”;

Object here “Here or anywhere”
with description “You are somewhere.”,
has light;

object ball “ball” here
with name ‘ball’,
description “A red ball.”;

[ Initialise; location = here; ];
Include “grammar”;[/code]

‘x//’ is not recognized.


#3

Bocfel automatically rewrites abbreviations before the game gets access to it:

Perhaps it would be better if it detected modern games (or tried to based on the serial number) and disabled this.


#4

Oh, thanks… I didn’t know that!
It’s an option, maybe it would be better to reverse it: turned on abbreviations with -x for old game and nothing for recent game.
Can the interpreter change the way Inform works?
For me, it’s like a bug: Interpreter must not return 0 if ‘x//’ is in the grammar and in the dictionary.


(Andrew Plotkin) #5

Obviously you mean it should try to detect old games. :slight_smile: The list of Z-code games which don’t support “X” for “EXAMINE” – but should – is just the Infocom canon, right?


#6

You’re right. In fact Bocfel already has a big list of Infocom V1-4 games, would that be all of them, or would it need the version 5 games to be added as well? github.com/garglk/garglk/blob/m … erp.c#L203

Actually, this code makes it look like the abbreviation expansion should only be applying to Infocom games anyway: github.com/garglk/garglk/blob/2 … ict.c#L207

Added 4 years ago, but after the last release of Gargoyle.

auraes are you using the Bocfel from Gargoyle? We really need to do another release of Gargoyle. It’s 7 years old now!


#7

Yes, from my linux distribution software repository (Gargoyle, version 2011.1b-1).