test(): Boolean ==

     res : List INT := [i for i in 1..3]
     s1 : Stream INT := res :: Stream INT
     aMap : INT ->  INT := i +->  i+1
     s2 := map(aMap, s1)
     explicitlyFinite? s2

    Function declaration test : () ->  Boolean has been added to
       workspace.
                                                                    Type:
Void
(8) ->  test()
    Compiling function test with type () ->  Boolean

    (8)  false

This is strange, indeed, but it is not so much a problem of whether the
function is defined in a file or on the command line, it is rather
different when there is a function of there is not function.

Simply remove the "test(): Boolean ==" from your test.input and and do
not indent the other lines. Then ")r test.input" gives.

(1) -> )r test.input
res : List INT := [i for i in 1..3]


   (1)  [1,2,3]
                                                          Type:
List(Integer)
s1 : Stream INT := res :: Stream INT


   (2)  [1,2,3]
                                                        Type:
Stream(Integer)
aMap : INT -> INT := i +-> i+1


   (3)  theMap(*1;anonymousFunction;0;frame1;internal)
                                                   Type: (Integer ->
Integer)
s2: Stream(INT) := map(aMap, s1)


   (4)  [2,3,4]
                                                        Type:
Stream(Integer)
explicitlyFinite? s2


   (5)  true
                                                                Type:
Boolean

On the other hand, defining the function on the command line inside the
interpreter, also returns false.

(6) -> test2(): Boolean == (res:List(INT) := [i for i in 1..3]; si:
Stream(INT) := res::Stream(INT);aMap:INT->INT := i+->i+1;s2:Stream(INT)
:= map(aMap,s1);explicitlyFinite? s2)

   Function declaration test2 : () -> Boolean has been added to
      workspace.

Type: Void
(7) -> test2()
   Compiling function test2 with type () -> Boolean

   (7)  false
                                                                Type:
Boolean

I've not yet a good explanation for this.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to