[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk: questions:
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] gawk: questions: |
Date: |
Mon, 14 Jan 2013 09:38:20 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi,
On Mon, Jan 14, 2013 at 05:44:55AM +0200, Denis Shirokov wrote:
> I understand how it works but isarray() was impemented started from
> GAWK4. This is the new function and therefore it's will be easy to fix
> it, - without any compatibility problems. isarray() - should not chage
> anything(safe read).
Sorry, no, it is not easy to fix it.
> Also, i implement the following procedure in my codes:
>
> #_________________________________________
> func _is(p) { ###########################
> if ( isarray(p) ) return -1
> if ( p==0 && p=="" ) return
> is=p; return 1 }
>
> this function determinate type of parameter `p':
> _Is(p is array,string or undefined? return -1 : 1 : undefined)
>
> With current gawk isarray functionality that kind of function cannot
> be implemented because isarray(p) will be allways define parameter `p'
> as the string and undefined state `p' - will be lost.
>
> Many functions requires to know, what type of the parameter is
> present: string or array or not present(undefined). This allows to
> create more comfortable(complex) function sets.
Sorry, this just won't work. If you access the array element, it is created.
That is not easy to fix.
Regards,
Andy