Dear all,
I just found out that Object.is blocks on undetermined FS variables.
Instead, I would expect that Object.is immediately returns false --
as it does for determined FS variables (see below). I tested it on
MacOS X. Could someone please confirm whether this problem also
occurs on other systems?
%% Blocks
{Object.is {FS.var.decl}}
%% does not block
{Object.is {FS.value.make [1 2 3]}}
BTW: testing whether something is a FS variable is tricky with the
buildin functions. In particular, FS.var.is returns false for
determined FS (!!), a behaviour I find very confusing (and we already
have IsDet anyway). Therefore, I wrote my own function which combines
the available functions to something which works for determined and
undetermined FS variables. Why do the buildin functions behave this
way? Should we have a more general function like the one below as a
builtin?
/** %% IsFS returns true if X is a FS variable (determined or not)
and false otherwise. This function is necessary, because the
primitive Oz functions FS.var.is and FS.value.is behave differently
for determined and undetermined FS variables.
%% */
fun {IsFS X}
if {IsDet X}
%% returns true for determined FS and blocks otherwise
then {FS.value.is X}
%% !! returns false for determined FS
else {FS.var.is X}
end
end
Best
Torsten
PS: I already filed a bug report concerning Object.is.
--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-233667
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users