On Thu, Jul 17, 2008 at 11:33 PM, Yixin Cao
<[EMAIL PROTECTED]> wrote:
>
>
> On Thu, Jul 17, 2008 at 10:13 PM, Bill Page <[EMAIL PROTECTED]>
> wrote:
>>
>> On Thu, Jul 17, 2008 at 10:49 PM, Yixin Cao wrote:
>> > With this patch, categories can be declared conditionally with
>> > 'is' operator, e.g.
>> >
>> > Fake(T:Type, a:T): Public == Private where
>> >   Public == CoercibleTo OutputForm with
>> >     if T is Integer and a is 10 then CommutativeRing
>> >     if T is Matrix(Integer) then leftUnitary
>> >
>> > ...
>>
>> That looks pretty cool! I'd like to know more.
>>
>> Can you tell me where I can find details of the semantics and examples
>> of other uses of the 'is' operator in SPAD? So far as I recall, only
>> 'has' is discussed in chapters 11, 12, 13 of the Axiom book. Where
>> else can I look?
>
>
> ATM I cannot answer your question.

The only documentation about 'is' that I know of is in the Boot
language. See Section "2.3.11 Patterns" of src/boot/Makefile.pamphlet,
or here:

http://axiom-wiki.newsynthesis.org/axiom--test--1/src/boot/Makefile

But not all of Boot is available in Spad.

The thing that concerns me is that your new use of 'is' might not be
compatible with it's use in pattern matching in Boot.

For example in the interpreter already I can write:

(1) -> [2,3] is [x,y]

   (1)  true
                                                   Type: Boolean
(2) -> x

   (2)  2
                                                   Type: PositiveInteger
(3) -> y

   (3)  3
                                                   Type: PositiveInteger


> But I can show something else:
> currently when you want to say if T2 is some specific domain, T1(T2)
> has something, you write
>
>     if T2 has DomName then Attr
>
> The problem is:
> "has" is supposed to handle Categories(attributes, signatures), but not
> domain. Currently "Integer has Ring" and "Integer has Integer" are both
> used in the compiler.

I understand that 'has' is supposed to check for membership of a
domain in some category:

   domain has category

I did not know about the use of expressions of the form "T2 has DomName"

  Integer has Integer

where can I find this used?

> Actually, (Integer has Integer) will return false in the interpreter.
>

The interpreter returns false for

  Integer has xxx

where 'xxx' is anything at all except a category to which Integer belongs.

Regards,
Bill Page.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to