Post a reply
Note:If not registered, provide any username. For more comfort, register here.
Message body:
Enter your message here, it may contain no more than 60000 characters. 

:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.

Topic review - overloading "[" operator for newstructs
Author Message
  Post subject:  overloading "[" operator for newstructs  Reply with quote
Hello everyone, I am currently working on a package for handling arrangements of hyperplanes.

I already managed to get the operators "+" and "=" working to my confidence, but I am still struggling with "[".
So I want it to behave the same for our newstruct "arr" (which is basically a list) as it does for lists/ideals.

system("install", "arr" , "[", arrGet ,2);
I managed to get access, i.e. A[2]; returns me the second second hyperplane for an arrangement A.
However I cannot figure out to overload this for assignement, i.e. that A[2] = h; would actually save h as the second hyperplane of my arrangement.

So as far as I know in C one can do this like
public object this[int i]
    get { return InnerList[i]; }
    set { InnerList[i] = value; }

Is there a way to do this in Singular, too?
Post Posted: Wed Mar 19, 2014 5:35 pm

It is currently Sun Dec 16, 2018 5:15 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group