🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #27231

Re: class A: print A

#27231
From: Łukasz Rekucki
Date: Tue, 19 Jan 2010 13:16
31 lines
2031 bytes
On Jan 19, 12:34 pm, Rob Wolfe <r...@smsnet.pl> wrote:
> William Bonawentura napisał(a):
>
> > > Jak wyja�ni� takie zachowanie interpretera?
>
> > W C++ czy Javie kompilacja jest dwuprzebiegowa i A byloby znane.
> > Interpretacja jest jednoprzebiegowa i A jeszcze nie zostalo przypisane.
>
> Tak z ciekawosci, moglbys pokazac analogiczny kod w C++ lub Javie,
> ktory dziala:
> class A:
>     print A
>
> ?
W Javie to pewnie byłoby coś w stylu:

public class A {
	static {
		System.out.println(A.class);
	}
}

Zachowa się podobnie - print się wykona kiedy klasa zostanie wczytana
i zainicjowana przez ClassLoader. Nie mówię, że to to samo, ale jest
blisko.

>
> RW

Pozdrawiam,
Łukasz Rekucki
Technical Details
Message-ID: <378e1c04-77a0-4f46-86af-b0ded030666c@b10g2000yqa.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!b10g2000yqa.googlegroups.com!not-for-mail
References: <2c102a9d-5722-4565-8562-346d08ec395d@34g2000yqp.googlegroups.com> <hj40q5$2ce8$1@news2.ipartners.pl> <c6924af6-5622-4795-951a-0158e63fcc6e@r19g2000yqb.googlegroups.com>

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!b10g2000yqa.googlegroups.com!not-for-mail
From: Łukasz Rekucki <lrekucki@gmail.com>
Newsgroups: pl.comp.lang.python
Subject: Re: class A: print A
Date: Tue, 19 Jan 2010 05:16:42 -0800 (PST)
Organization: http://groups.google.com
Lines: 31
Message-ID: <378e1c04-77a0-4f46-86af-b0ded030666c@b10g2000yqa.googlegroups.com>
References: <2c102a9d-5722-4565-8562-346d08ec395d@34g2000yqp.googlegroups.com>  <hj40q5$2ce8$1@news2.ipartners.pl> <c6924af6-5622-4795-951a-0158e63fcc6e@r19g2000yqb.googlegroups.com>
NNTP-Posting-Host: 212.76.62.207
Mime-Version: 1.0
X-Trace: posting.google.com 1263907002 12411 127.0.0.1 (19 Jan 2010 13:16:42 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 19 Jan 2010 13:16:42 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: b10g2000yqa.googlegroups.com; posting-host=212.76.62.207;  posting-account=5fpXZwoAAADF-CUdCuJ-FpYxG8__-wRx
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)  AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.64 Safari/532.5,gzip(gfe),gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit