The Spad of ... => error "Foo" (newline() :: OutputForm) " Foo"
is compiled by FriCAS-1.1.5, and at the run time, it reports
>> System error:
SYSTEM::%EXPAND-FORM: invalid form ("Foo"
((|::| (|newline|) (|OutputForm|)) " Foo")
I do not know whether this should pass the compiler,
I report this for any occasion.
Regards,
------
Sergei
mec...@botik.ru
AFAIK, the function "error" expects a string as argument. What you have
given, isn't of type String. Maybe you should rather write
error concat ["foo",newline()::String,"bar"]
(I haven't actually tested it in SPAD, but it works on the command line.)
Ralf
Could you post complete example? When I tried to complete your
line I got error at compile time.
ATM I can not say if compiler should accept your line, but
if compiler accepts the line it should generate correct
code and the message suggests that this in not the case.
--
Waldek Hebisch
heb...@math.uni.wroc.pl
AFAICS Spad compiler converts application of a string to
another string into concatentation of strings. Assuming
this convertion the result is a string.
--
Waldek Hebisch
heb...@math.uni.wroc.pl
>> AFAIK, the function "error" expects a string as argument. What you have
>> given, isn't of type String.
> AFAICS Spad compiler converts application of a string to
> another string into concatentation of strings. Assuming
> this convertion the result is a string.
1) The line above contains newline()::OutputForm. If it had been
::String, I wouldn't probably have had a big problem.
2) If the compiler implicitly treats
"a" "b"
as "ab" then that would mean either
a) the existence of a function
apply: (String, String) -> String
(or "elt" instead of "apply" since we are in SPAD instead of
Aldor), or
b) the SPAD compiler implements syntactic sugar to translate
s1 s2 ... sn into concat [s1,s2,...,sn] where the si are all of
type String, or
c) like b) except that all si must be String literals.
I don't know for sure, but I guess that c) holds.
Adding a function "elt"/"apply" could make that compiler feature irrelevant.
Waldek, don't you think that some day the domain Literal should be part
of SPAD?
Ralf
Sorry, I have lost this state.
I thougth it is easy to reproduce, but it is not.
Also I have changed to FriCAS-1.1.6 built from source under SBCL 1.0.55
(it is about 3 times faster on my examples).
Regards,
------
Sergei
mec...@botik.ru