On Wed, Feb 03, 2021 at 08:20:45PM -0500, Tobias Neumann wrote:
> >
> > What comes to my mind when I hear Feynman integrals is work of my
> > colleague in his collaboration with DESY.
> >
> > https://risc.jku.at/m/carsten-schneider/
> 
> 
> The academic world is small, in fact I know a few collaborators of your
> colleague.
> 
> Here is a new problem that I came across. I have a simple wrapper over sort,
> trying to sort a list of lists of integers.
> 
> The interpreter has no problems with that:
> 
> test := [[1,2],[2,1],[-1,1]]
> 
> (4) -> sort(test)
>  Function Selection for sort
>       Arguments: LIST(LIST(INT))
>  [1]  signature:   LIST(LIST(INT)) -> LIST(LIST(INT))
>       implemented: slot $$ from LIST(LIST(INT))
>    (4)  [[- 1, 1], [1, 2], [2, 1]]
>                                                     Type:
> List(List(Integer))
> 
> My wrapper implementation (code below):
> 
> (5) -> mysort(test)
>  Function Selection for mysort
>       Arguments: LIST(LIST(INT))
>  [1]  signature:   LIST(LIST(INT)) -> LIST(LIST(INT))
>       implemented: slot (List (List (Integer)))(List (List (Integer))) from
> MYSORT
>    >> System error:
>    The value
>   (-1 1)
> is not of type
>   NUMBER
> when binding SB-KERNEL::X
> 
> ---- SNIP ----
> )abbrev package MYSORT MySort
> 
> MySort() : Exports == Implementation where
> 
>     Exports ==> with
>         mysort : List(List(Integer)) -> List(List(Integer))
>     Implementation ==> add
> 
>         if List(List(Integer)) has OrderedSet then
>             mysort lst ==
>                 sort(lst)
>         else
>             error "nope"

Error looks like compiler bug.  However, the correct conditon
is different, and then AFAICS code works:

        if List(Integer) has OrderedSet then
            mysort lst ==
                sort(lst)

In this case workaround is simpler:

        mysort lst == sort(_<, lst)

That is explicitely pass sorting predicate to two argument sort.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20210204034104.GA19193%40math.uni.wroc.pl.

Reply via email to