To my

> > It looks like    Product(Ring, Any)
> >
> > is not possible, because `Product' needs SetCategory for each
> > component. The same is with  Record.
> > Right?
> > So, what is the most natural replacement for  Product(Ring, Any)
> > ?

On Mon, Feb 13, 2012 at 08:43:52PM -0500, Bill Page wrote:
> Perhaps
> 
>   Record(pi1:Ring, pi2:Any)
> 
> ?
> 
> What properties of Product do you need?

Thank you.

In  docs  it is written that  Product  and  Record  need  SetCategory  for 
each component. And I thought that  Any  has not  SetCategory,  I thought
that Any is more generic than Set.
But now, I try in the interpreter:

    -> has(Any, SetCategory)
       true                    : Boolean

Really, is  Any  of SetCategory ?
Now, assuming "yes", I try the code (which is close to what I need):

-----------------------------------------
ANY1          ==> AnyFunctions1
SetAnyLexList ==>
              Record(dom : SetCategory, val : Any, remList : List String)

)abbrev package FOO Foo
Foo() : with    p : List String -> SetAnyLexList  ==
  add
    p(lexs : List String) : SetAnyLexList ==
                               [Integer, coerce(1) $ANY1(Integer), rest lexs]
-----------------------------------------

Is this all right?
After compilation, I run it under the interpeter:

--------------------------------------------------------------
 ...
 |$ConstructorCache|
0 errors, 4 warnings
------------------------------------------------------
   Foo is already explicitly exposed in frame initial 
   Foo will be automatically loaded when needed from 
      /home/mechvel/ghc/axiomInterface/fromA-aim/FOO.NRLIB/FOO

(5) -> p ["a"]

   >> System error:   
FUNCALL: ((|latex| ((|String|) $)) T (ELT $ 8)) is not a function name; 
try using a symbol instead
-------------------------------------------------

If I change `SetCategory' to `Type', then the compiler again compiles this.
But  has(Type, SetCategory) = false.  
So, should not it report an error?

Then, in the interpreter, it shows in the result  NIL  intstead of  Integer
in the first component of the record.
I suspect that the reasons for all this are similar to ones explained in the 
last response of Waldek to by question of "subtle f signature"
[ 1) a certain bug,  2) the specifics of the Interpeter mode,  ... ].

I hope that the whole my parsing program will still work with 
Record(dom: SetCategory, ...),  because the function of this kind is used
by Spad functions.
But  1) it needs trying,
     2) anyway it will be nice to see the explanation for this above code 
        with Record.

Thanks,

------
Sergei
[email protected]

-- 
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