On Thu, Aug 26, 2021 at 05:23:50PM +0800, Qian Yun wrote:
> Currently "hash" gives error for List, like:
> 
> (1) -> hash [1]
> 
>    >> System error:
>    The value
>   1
> is not of type
>   CONS
> 
> The reason is that "Qfirst" in following patch is
> a Lisp function without type, so compiler assumes
> its type to be '%' instead of "S".
> 
> diff --git a/src/algebra/list.spad b/src/algebra/list.spad
> index e3d19e51..c4c7a0d1 100644
> --- a/src/algebra/list.spad
> +++ b/src/algebra/list.spad
> @@ -173,7 +173,7 @@ List(S : Type) : Exports == Implementation where
> 
>          hashUpdate!(s : HashState, x : %) : HashState ==
>              while not empty? x repeat
> -                s := hashUpdate!(s, Qfirst x)
> +                s := hashUpdate!(s, Qfirst x)$S
>                  x := Qrest x
>              s
> 

Good catch, please commit.
-- 
                              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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20210826125626.GA4957%40math.uni.wroc.pl.

Reply via email to