Ok. This is fixed. There is a gotcha here. Prolog variables have no name (as you undoubtedly know), so there is no way to associate the Prolog variable with the
@(D:day) The system now checks for prolog_load_context/2 using the
variable_names context to work around this. The price for normal Prolog code is that you still get a singleton warning.
To make dynamic usage of #pred possible, the variables may be instantiated to atoms as below. The thing in the template must satisfy the rules for a Prolog variable. If the term contains a matching atom, this is replaced by the variable.
#pred opera('D') :: 'I can be at the opera on @(D:day)'.
For the version of s(CASP) web server this is not an issue as this doesn’t use normal Prolog file loading and the terms are read without singleton warnings enabled, after which we bind variables in #pred terms to their name.
I think this should in due time be replaced with grammar rules, something like
[ 'I can be at the opera on ' ],
Good news is that there is now also support in there is now also s(CASP) support in SWISH. See the intro page