Ask Your Question

Revision history [back]

gap record

Hello,

I would like to manipulate gap records (association name -> value) through sage... but it does not seem available. Here is a sample from GAP

gap> rec( a := 1, b := "deux" ); rec( a := 1, b := "deux" ) gap> r.a; 1 gap> r.b; "deux"

But in Sage

sage: w = gap('rec( a := 1, b := "deux" );') sage: w rec( a := 1, b := "deux" ) sage: w.a a sage: w.b deux

Which is very strange!! Hopefully, it is still possible to do

sage: gap("{}.a".format(w._name)) 1 sage: gap("{}.b".format(w._name)) deux

Is there a better way to deal with them?

Thanks Vincent

gap record

Hello,

I would like to manipulate gap records (association name -> value) through sage... but it does not seem available. Here is a sample from GAP

gap> rec( a := 1, b := "deux" );
rec( a := 1, b := "deux" )
gap> r.a;
1
gap> r.b;
"deux"

"deux"

But in Sage

sage: w = gap('rec( a := 1, b := "deux" );')
sage: w
rec(
  a := 1,
  b := "deux" )
sage: w.a
a
sage: w.b
deux

deux

Which is very strange!! Hopefully, it is still possible to do

sage: gap("{}.a".format(w._name))
1
sage: gap("{}.b".format(w._name))
deux

deux

Is there a better way to deal with them?

Thanks Vincent

gap record

Hello,

I would like to manipulate gap records (association name -> value) through sage... but it does not seem available. Here is a sample from GAP

gap> rec( a := 1, b := "deux" );
rec( a := 1, b := "deux" )
gap> r.a;
1
gap> r.b;
"deux"

But in Sage

sage: w = gap('rec( a := 1, b := "deux" );')
sage: w
rec(
  a := 1,
  b := "deux" )
sage: w.a
a
sage: w.b
deux
b

Which is very strange!! Hopefully, it is still possible to do

sage: gap("{}.a".format(w._name))
1
sage: gap("{}.b".format(w._name))
deux

Is there a better way to deal with them?

Thanks Vincent