[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: A shorter syntax to reference past elements of array



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxx> wrote:
>
> Perhaps the least confusing form would be C[i]

I don't really like that syntax:

1) Conceptually, it is actually more confusing because now [] can
refer to an absolute array position or a relative position (if negative)

2) I think this may involve additional overhead (by Tomasz) for bounds
checking on every array element access.  Just a guess -- Thomasz would
be the one who has to implement it.  :)

3) Worst of all this has the potential to introduce insidious bugs
into looping code where you go beyond the intended array boundary of
"0" and start accessing relative array values (by using a negative
number).  The code would now be incorrect, no errors would be raised,
the results would be totally wrong and it could be very difficult to
find that type of error.  Sure you could add checks to avoid that
scenario, but why make things more difficult?


Tuzo


> if  i > 0, then i is array subsript (current difinition)
> if i < 0, then Ref(C,-5)  = C[-5] . No allowance can be made for future 
> bars.
> 
> Ara
> 
> ----- Original Message ----- 
> From: "Tomasz Janeczko" <groups@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, February 19, 2009 8:45 AM
> Subject: Re: [amibroker] A shorter syntax to reference past elements of 
> array
> 
> 
> > Hello,
> >
> > I am sorry guys for ommission of C(-5) option. I have edited the
poll, but
> > that unfortunatelly erased the votes placed already, so please
re-submit 
> > your vote.
> >
> > I appologize once again for this inconvenience.
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "Thomas Ludwig" <Thomas.Ludwig@xxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Thursday, February 19, 2009 5:36 PM
> > Subject: Re: [amibroker] A shorter syntax to reference past
elements of 
> > array
> >
> >
> > Hello,
> >
> > I agree with this view. Shortening ref(C, -5) to C(-5) is fine but
not to
> > C(5) - that's confusing. It's a pity that this option is not
offered in
> > the poll.
> >
> > Thomas
> >
> >> Sorry , but imo the new forms are critic and counter intuitive.
> >>
> >> C(5) looks back 5 bars.... what would looking forward look like?
> >> C(-5)?
> >>
> >> imo, very confusing. I can't help but wonder what made this idea
> >> surface :-))
> >>
> >> herman
> >>
> >> Thursday, February 19, 2009, 11:08:25 AM, you wrote:
> >> > Hello,
> >> >
> >> > As a convenience feature I was contemplating for some time to allow
> >> > shorter syntax to very common operation of referring to past
> >> > elements of the array. As you now current syntax to refer to past
> >> > is:
> >> >
> >> > Ref( array, -bars )
> >> >
> >> > So close five bars back is Ref( C, -5 )
> >> >
> >> > I don't have any technical problem with adding new
> >> > operator that will make it shorter,
> >> > but I am wondering about the most preferrable "form",
> >> > that is easy to use and does not create confusion.
> >> >
> >> > So I would like to ask you which
> >> > "short form" would you prefer.
> >> > - C@x
> >> > - C#5
> >> > - C(5)
> >> > - I don't like the idea at all
> >> >
> >> > Please use this poll to vote:
> >> > http://finance.groups.yahoo.com/group/amibroker/surveys?id=2828485
> >> >
> >> > Thank you.
> >> >
> >> > Best regards,
> >> > Tomasz Janeczko
> >> > amibroker.com
> >> >
> >> >
> >> > ------------------------------------
> >> >
> >> > **** IMPORTANT PLEASE READ ****
> >> > This group is for the discussion between users only.
> >> > This is *NOT* technical support channel.
> >> >
> >> > TO GET TECHNICAL SUPPORT send an e-mail directly to
> >> > SUPPORT {at} amibroker.com
> >> >
> >> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> >> > http://www.amibroker.com/feedback/
> >> > (submissions sent via other channels won't be considered)
> >> >
> >> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> >> > http://www.amibroker.com/devlog/
> >> >
> >> > Yahoo! Groups Links
> >> >
> >> >
> >> >
> >>
> >
> >
> >
> >
> > ------------------------------------
> >
> > **** IMPORTANT PLEASE READ ****
> > This group is for the discussion between users only.
> > This is *NOT* technical support channel.
> >
> > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > http://www.amibroker.com/feedback/
> > (submissions sent via other channels won't be considered)
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> > ------------------------------------
> >
> > **** IMPORTANT PLEASE READ ****
> > This group is for the discussion between users only.
> > This is *NOT* technical support channel.
> >
> > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > http://www.amibroker.com/feedback/
> > (submissions sent via other channels won't be considered)
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/