Obviously that what you want does not exist.
Unfortunately, I am not a user of the Guessing package to be able to
give you a suggestion just so.

To get a rough idea of what you actually want to achieve by
GuessingHelpers it would be very helpful to know what (for example)
the function guess_func_level_1

https://gitlab.com/nsajko/fricas_guessing/-/blob/master/guessing_helpers.spad#L187

is supposed to do. Can you also give example calls (i.e. actual
parameters) for that function.

Maybe then I would be able to give a suggestion for such a helper package.

If you just want the *two* Fraction Integer and Fraction Polynomial
Integer as parameter domains, why would you want to abstract one common
category for it? You must have some more domain parameters in mind.

Ralf



On 16.12.21 21:31, Neven Sajko wrote:
> In the process of writing some Spad packages, I realized that I need
> to generalize one of them by introducing another package parameter,
> because one of the types would need to be determined by the caller.
> 
> Source file: 
> https://gitlab.com/nsajko/fricas_guessing/-/blob/master/guessing_helpers.spad
> 
> The package is GuessingHelpers, and the problematic parameter is "In".
> Before I tried to turn it into a parameter, it was simply defined as
> Fraction Integer, however I want to generalize the package so that In
> can be either a Fraction Integer or a Fraction Polynomial Integer.
> 
> For a start, I declared In like this:
> 
> In: Join(Field, CoercibleFrom Integer, CoercibleFrom Fraction Integer)
> 
> However, this predictably fails, as my package requires In to be
> coercible to Expression Integer.
> 
> If I declare In like this:
> 
> In: Join(Field, CoercibleFrom Integer, CoercibleFrom Fraction Integer,
> CoercibleTo Expression Integer)
> 
> Then I can't construct the package because Fraction Integer doesn't
> have the CoercibleTo Expression Integer category.
> 
> How should I declare In?
> 
> Is it possible to declare a package parameter so as to enumerate a set
> of types, and saying that the parameter has to be a member of that
> set? This would work for me, I could simply declare In as "either
> Fraction Integer or Fraction Polynomial Integer".
> 
> Thanks,
> Neven
> 

-- 
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/6a8269f5-325d-7810-b52f-04011dd3b853%40hemmecke.org.

Reply via email to