The Smallest of Problems

I have run into the smallest of problems while coding in Dialog.

Here is some code to illustrate:

(current player #alice)
(#alice is #in #room)
(room #room)

#black-kitten

(name *) black kitten
(* is #heldby #alice)

#white-kitten

(name *) white kitten
(* is #heldby #alice)

#sister

(name *) your sister
(dict *) my
(proper *)
(* is #in #room)

(perform [show #black-kitten to *])
    (The #sister) says, "(The #black-kitten) is quite adorable, isn't it?"

(perform [show #white-kitten to *])
    (The #sister) says, "The white kitten has grown quite large, hasn't it?"

And here is a transcript:

> show black kitten to sister
Your sister says, " The black kitten is quite adorable, isn't it?"

> show white kitten to sister
Your sister says, "The white kitten has grown quite large, hasn't it?"

The problem (which is easy enough to miss) is that there is a space between the quotation mark and the phrase “The black kitten”. If (the *), (A *), or (a *) is substituted for (The *), the problem persists.

What is happening here?

3 Likes

Remember that Dialog treats output as a stream of words and characters, and normally does an excellent job of dealing with streaming that out as sentences with correct whitespace.

As a short term solution, adding (no space) in front of (The #black-kitten) should override Dialog’s default logic for this case.

That being said, and away from my home computer where I can test, I’m surprised that the built-in logic inserts a space there. But looking at my code I think I hit the same issue and, yes, used (no space) to fix it.

2 Likes

Yes, that explains it!

I am off to insert a (no space). Thank you!