Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

give access to member functions #51

Open
videlec opened this issue Jan 4, 2018 · 3 comments
Open

give access to member functions #51

videlec opened this issue Jan 4, 2018 · 3 comments

Comments

@videlec
Copy link
Collaborator

videlec commented Jan 4, 2018

In gp there are member functions that are accessible in an object oriented fashion

? K = bnfinit(x^3 - 2);
? bnf = bnfinit(x^3 - 2);
? bnf.nf     /* = bnf[7] */
%3 = [x^3 - 2, [1, 1], -108, 1, ...]
? bnf.clgp   /* = bnf[8][1] */
%4 = [1, [], []]

These functions are described in pari.desc and belong to the section "member_functions". We should add support for them in cypari2 (as methods or properties).

@jdemeyer
Copy link
Collaborator

jdemeyer commented Jan 4, 2018

We should add support for them in cypari2 (as methods).

Maybe properties to have a syntax similar to GP? Also note that in theory, a member could have the same name as a GP function. This is currently not the case in practice.

@jdemeyer
Copy link
Collaborator

Also note that in theory, a member could have the same name as a GP function. This is currently not the case in practice.

Actually, there is: omega is a function and member with very different meaning.

@videlec
Copy link
Collaborator Author

videlec commented Jan 29, 2019

Some possibilities

  • Choose function by default if there is a clash
  • Use my_gen["X"] or my_gen.member.X or my_gen.member["X"] for GP member functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants