Re: Found Good docs - Revisiting Pike

2026-01-10 Thread Duke Normandin
@ Leif Stensson

I had not received any posts from the Pike mailing list, so I visited the Pike
mailing list archives and found your reply.

I'm very weak with functional programming and a total newbie to OOP, so I will
have to study more to understand your reply. For now, I at least know that
there is a reason for syntax.  Thank you!
--
Duke



Re: Found Good docs - Revisiting Pike

2026-01-08 Thread Duke Normandin
On Thu, 8 Jan 2026 15:44:52 -0700
Duke Normandin  wrote:

> I'm currently studying the pike manual/chapter_5.html#5.5 Indexing
> 
> A sample quote:
> 
> Function SyntaxIdent   Returns
> 
> Index   a [ b ]`[]   Returns the index b from a. 
> 
> Safe Index  a [? b ]   none  Returns the index b from a, returning 0
> instead of an error of a is 0
> 
> Lookupa ->ident  `->  Looks up the identifier. Same as
> a["ident"].
> 
> I don't understand the `[] and `-> syntax. I need some simple examples of
> usage. Also a ->ident aka a["ident"] escapes me. What is meant by "Ident" i.e.
> "Identifier"?

Found a clue!!

string str;
str = "pike";
str[2]; => 107
`[](str,2)  => 107

Which of these two constructs is preferable?
Is there a reason for having two ways of indexing?
-- 
Duke