From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20783 invoked by alias); 30 Jun 2016 14:56:51 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21714 Received: (qmail 26128 invoked from network); 30 Jun 2016 14:56:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=oBoW6vmsQSgs+JEETQG61YudrCQdX1cB5tny5yZV21U=; b=Ceo8XmdObtcYoEvGxZwH5EvHyZxUcSD1vaLAqv+KFES1zG71zX37PppZl4h3KYbHoN JwFJGCSMD2Yr2e1MGEqK03j/0WIxjyZ3hxVRP/OmCGSGjMoib9msC8/bD3MUnDmCF4Sq XEcOzyQlQ2yatBJJXMor/d1WAPJxzbw1frvvYaHwA2j+miy6xsZLRZxMhUlF2CQMLt7Y 5CBnKicW/z74BVcKPCQpLDntovPfNjMvcsKlwuJSKMXE/9KLmrqL0TENxW8alTueFEzj ogCy+6ulDfAafJJG5NTsNzb2uORj+HPeDqD/g0eTuDN8OzoCC0nzairpNEGtWtSLHLWk vIXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=oBoW6vmsQSgs+JEETQG61YudrCQdX1cB5tny5yZV21U=; b=A+YBQr565k8+e4RwMH1j2eK7sUKHg/9FcBvCuQKG3eKBA3gOVQUMFAJi55Cqv92fYu G/QljE+jk63P2v80DHidPUz53EudkNYei7DHdTRJfhJxSOe5J2LSMKuNPq1JlMd/dhh5 s4bRcIOPJ5K3/jNPmAjK2VOcrorPA1EXv+TRZzA16wftXYIHz1oHDtyyiQGWqg8o9Xzc KUA/AvYEN2sWlQ30Vnl5hGaW+kA9toPynaKWlFBL8IkdfG9jRICd/bogT61FsYas5njK M6CsRRDJkKl52ypFBaGpsR0FGsniILPNRo6dAxlikjTqa0FCdWOtADwZHw6tBhwYdFx2 7yrQ== X-Gm-Message-State: ALyK8tLM0UUzA6/J8nxtvaPbqPO9BpcAESlfSyRfuCIjG/1M6obN/cUnOOSpW1w+cA+mY/FGErb/41yxdrnDhw== X-Received: by 10.55.152.198 with SMTP id a189mr19085811qke.208.1467298609693; Thu, 30 Jun 2016 07:56:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Sebastian Gniazdowski Date: Thu, 30 Jun 2016 16:56:30 +0200 Message-ID: Subject: Re: Global array actually not available To: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sorry apparently I missed the fact that zkview runs two programs, itself and zsh-select-zekyll. Maybe I will clarify what can be wrong if at all. Best regards, Sebastian Gniazdowski On 30 June 2016 at 16:34, Sebastian Gniazdowski wr= ote: > Hello > > In code, I declare reply2 and reply3 as arrays via typeset -ga. I do > this from inside of a function. When the code returns to outer scope, > (t)reply2 and (t)reply3 show empty strings. The following lines start > at line 293 in lib/script_functions: > > typeset -ga reply2 reply3 > echo "T1 ${(t)reply} T2 ${(t)reply2} T3 ${(t)reply3}" > reply=3D( "${existing[@]}" ) > reply2=3D( "${files[@]}" ) > reply3=3D( "${sections[@]}" ) > > This is inner scope. The outer scope (line 1148 in zsh-select-zekyll) doe= s: > > filter_for_existing_zekylls "${zekylls[@]}" > three_to_section_order "${#reply}" "${reply[@]}" "${reply2[@]}" > "${reply3[@]}" > > echo "t1 ${(t)reply} t2 ${(t)reply2} t3 ${(t)reply3}" > local -a existing files sections > existing=3D( "${reply[@]}" ) > files=3D( "${reply2[@]}" ) > sections=3D( "${reply3[@]}" ) > > echo "existing count: ${#existing}, files count: ${#files}, > sections count: ${#sections}" > > t1-t3 show empty string. Assigning ${reply2[@]} to files=3D( ... ) cause > the variable files to contain one mysterious element =E2=80=93 it is empt= y, > probably. > > > To run the code first download zekyll, the investigation branch: > https://github.com/psprint/zekyll/tree/investig > > it has to be unpacked to ~/.zekyll, final directory "zekyll", so full > path ~/.zekyll/zekyl. One can also use install script: > > wget https://github.com/psprint/zekyll/blob/master/install.sh > sh ./install.sh > > Next, one also needs a zkl repository available under > ~/.zekyll/repos/{the-zkl-repo} or somewhere else (the path below after > -mp must match). It can be downloaded from: > > https://github.com/psprint/zkl > > After that, simply run command: > > zkview -mp "/Users/sgniazdowski/github/zkl.git" --zkl > aaaaabaacaadaaeaafaagaahaaiaajaakaalaamaanaaoaap > > Errorneous output will be created: > > Read: aaaaabaacaadaaeaafaagaahaaiaajaakaalaamaanaaoaap > > Checking current zekyll for duplicates... > > T1 T2 array T3 array > -> aaa.A--Mainly_Exports > -> aab.A--Setopts_all > -> aad.B--Autoloads_tools_binds > -> aac.C--Bindkeys > -> aaf.D--Old_functions > -> aae.E--Aliases_all > -> aag.F--Tools_functions > -> aah.F--Other_functions > -> aaj.F--Off > -> aai.G--Hack > -> aak.H--Zplugin > -> aal.H--Zsh_navigation_tools > -> aam.I--Zstyles > -> aap.J--Completion > -> aan.K--Prompt_selection_final_setup > -> aao.L--Very_final > t1 t2 t3 > existing count: 1, files count: 1, sections count: 1 > > > Best regards, > Sebastian Gniazdowski