🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.tcl
Article #564

Re: Jak sobie z tym radzicie?

#564
From: Artur
Date: Sat, 02 Feb 2008 10:26
23 lines
1764 bytes
On 1 Feb., 17:20, T <t...@invalid.invalid> wrote:
> Prosty przykład:
>
> puts [exec abc]
>
> Problem powstanie gdy "abc" zwróci coś z [] itp.
> Można oczywiście przelecieć output regsubem czy czymś podobnym ale tego
> zdecydowanie chciałbym uniknąć ze względu na słabą wydajność.
>
W Tcl substytucja jest dokonywana tylko jeden raz. Czyli tylko na
pierwszym poziomie (to co widać).
dlatego nie ma problemu jeśli  [exec abc] zwróci jekieś  [] lub $.

Jakby się chciało wykonać następnej substytucji to trzeba by było
napisać

puts [subst [exec abc]]
albo
puts [eval [exec abc]]

Opisuje to dobrze http://wiki.tcl.tk/3205

Artur
Technical Details
Message-ID: <6f927185-10b5-4335-90ef-b142c7f76519@e25g2000prg.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!e25g2000prg.googlegroups.com!not-for-mail
References: <47a346dc$1@news.home.net.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!e25g2000prg.googlegroups.com!not-for-mail
From: Artur <mail@xdobry.de>
Newsgroups: pl.comp.lang.tcl
Subject: Re: Jak sobie z tym radzicie?
Date: Sat, 2 Feb 2008 02:26:26 -0800 (PST)
Organization: http://groups.google.com
Lines: 26
Message-ID: <6f927185-10b5-4335-90ef-b142c7f76519@e25g2000prg.googlegroups.com>
References: <47a346dc$1@news.home.net.pl>
NNTP-Posting-Host: 80.132.88.84
Mime-Version: 1.0
X-Trace: posting.google.com 1201947987 10657 127.0.0.1 (2 Feb 2008 10:26:27 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 2 Feb 2008 10:26:27 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e25g2000prg.googlegroups.com; posting-host=80.132.88.84;  posting-account=N_uYZwkAAABDWkO81XGBbcMdXBkcrHd9
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.11)  Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit