A lot of things should work if you just replace gap with libgap (or import libgap as gap). One difference is that the libgap() element constructor prioritizes creating the analogous gap object, in particular for strings:
sage: libgap('string') "string" sage: type(_) <type 'sage.libs.gap.element.GapElement_String'> If you want to evaluate a gap command as string, you need to use libgap.eval(). I think this is less confusing than mashing conversion and command execution into the same call. Also, more Python <-> GAP type correspondences are supported, and there is a class hierarchy of GapElements. For example dict<->rec: sage: r = libgap({'one':1}); r rec( one := 1 ) sage: type(r) <type 'sage.libs.gap.element.GapElement_Record'> sage: r['one'] 1 On Monday, September 24, 2012 11:14:31 AM UTC+1, William wrote: > > On Sun, Sep 23, 2012 at 1:00 PM, mmarco <mma...@unizar.es <javascript:>> > wrote: > > > >> How hard will porting code be? How much different is the interface > >> that Volker ended up developing for libGAP? > >> > > > > Porting my fpgroups code was pretty much straightforward. It is > > (almost) a mechanical work... but a work that has to be done. I am not > > sure if it is automatic enough to be done by a script. What i did is > > to change by hand all the definitions of the gap objects i use. After > > that, it is a matter of tuning stuff like opening and closing > > brackets, quotes and so on. > > > > To give you an idea: my poroject is about 2000 lines of code, a big > > part of it dealing with the gap interface. I don't remember exactly > > how much time it took to port itby hand it to the libgap interface; > > but i am sure i did it in less than a day. > > I wrote the first version of libGAP at the Barcelona Sage days a few > years, and at that time I had planned it to basically be a drop-in > replacement for the pexpect interface. Did the design diverge a lot > from that? > > > William > > > > > -- > > You received this message because you are subscribed to the Google > Groups "sage-devel" group. > > To post to this group, send email to > > sage-...@googlegroups.com<javascript:>. > > > To unsubscribe from this group, send email to > sage-devel+...@googlegroups.com <javascript:>. > > Visit this group at http://groups.google.com/group/sage-devel?hl=en. > > > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To post to this group, send email to sage-devel@googlegroups.com. To unsubscribe from this group, send email to sage-devel+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en.