Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

10.0 times 0.1 is hardly ever 1.0.


devel / comp.lang.tcl / Something odd with [oo::class create] on Tcl 8.6.13

SubjectAuthor
* Something odd with [oo::class create] on Tcl 8.6.13Alan Grunwald
`* Re: Something odd with [oo::class create] on Tcl 8.6.13Joerg Mertens
 `* Re: Something odd with [oo::class create] on Tcl 8.6.13Ralf Fassel
  `* Re: Something odd with [oo::class create] on Tcl 8.6.13Alan Grunwald
   `- Re: Something odd with [oo::class create] on Tcl 8.6.13Alan Grunwald

1
Something odd with [oo::class create] on Tcl 8.6.13

<usn9u8$3mlci$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13523&group=comp.lang.tcl#13523

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Something odd with [oo::class create] on Tcl 8.6.13
Date: Mon, 11 Mar 2024 16:02:10 +0000
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <usn9u8$3mlci$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Mar 2024 16:02:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="91c4b4f69f25346ac2482a7b997d47a9";
logging-data="3888530"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/flY2ZDxikxi3Y6oVRruWWSoqTbTbdkXI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:9phMWnNIhGOt3Y8s6rDyWBBsBwA=
Content-Language: en-US
 by: Alan Grunwald - Mon, 11 Mar 2024 16:02 UTC

Consider:

% oo::class create foo {constructor {} {}}
::foo
% set f [foo new]
::oo::Obj12
% set g [foo new a b c]
::oo::Obj13

I'd expect the second attempt to create an object to fail because there
are too many arguments.

Also:

% oo::class create foo {constructor {a} {}}
::foo
% set f [foo new]
::oo::Obj12
% set f [foo new a b c]
::oo::Obj13

I'd expect both attempts to create objects to fail because neither
specifies the correct number of arguments.

Have I misunderstood something (if so, what) or is there a bug here?

Re: Something odd with [oo::class create] on Tcl 8.6.13

<87jzm8whs2.fsf@jmertens.eternal-september.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13527&group=comp.lang.tcl#13527

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!jmertens.eternal-september.org!.POSTED!not-for-mail
From: joerg-mertens@t-online.de (Joerg Mertens)
Newsgroups: comp.lang.tcl
Subject: Re: Something odd with [oo::class create] on Tcl 8.6.13
Date: Mon, 11 Mar 2024 23:00:29 +0100
Organization: privat
Lines: 40
Message-ID: <87jzm8whs2.fsf@jmertens.eternal-september.org>
References: <usn9u8$3mlci$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: jmertens.eternal-september.org; posting-host="8256b9527aca7cb75caf5259cae0a6ee";
logging-data="4052032"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19g+Ks3z7Rs+p3juLNWsa9iCJsZND5wAik="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:IrUGKwgc3GYecG2D+7Gue0lPfLc=
sha1:yKr3/fdm91Aj0eLZORsqfZ3dzN4=
 by: Joerg Mertens - Mon, 11 Mar 2024 22:00 UTC

Alan Grunwald <nospam.nurdglaw@gmail.com> writes:

> Consider:
>
> % oo::class create foo {constructor {} {}}
> ::foo
> % set f [foo new]
> ::oo::Obj12
> % set g [foo new a b c]
> ::oo::Obj13
>
> I'd expect the second attempt to create an object to fail because
> there are too many arguments.
>
> Also:
>
> % oo::class create foo {constructor {a} {}}
> ::foo
> % set f [foo new]
> ::oo::Obj12
> % set f [foo new a b c]
> ::oo::Obj13
>
> I'd expect both attempts to create objects to fail because neither
> specifies the correct number of arguments.
>
> Have I misunderstood something (if so, what) or is there a bug here?

Looks like the constructor is not even created if the body is empty. As
soon as you put something in the body the arguments are checked:

% oo::class create foo {constructor {a} {puts hello}}
::foo
% set f [foo new a b c]
wrong # args: should be "foo new a"

Otherwise the behaviour is the same as if the class has no constructor
at all - you can provide an arbitrary number of arguments.

The question remains why these are not checked.

Re: Something odd with [oo::class create] on Tcl 8.6.13

<ygav85ry9xs.fsf@panther.akutech-local.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13534&group=comp.lang.tcl#13534

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: Something odd with [oo::class create] on Tcl 8.6.13
Date: Tue, 12 Mar 2024 12:19:11 +0100
Lines: 27
Message-ID: <ygav85ry9xs.fsf@panther.akutech-local.de>
References: <usn9u8$3mlci$1@dont-email.me>
<87jzm8whs2.fsf@jmertens.eternal-september.org>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net 6oF46eNbcwhEjQ64EYUYGAhG6p4RWKhpoOAeHDcXDmkhQbO1s=
Cancel-Lock: sha1:0OegYO/+wP5tZHo6by+hC81L58I= sha1:JsSNNE4lzL/dVsoIxyES6AYmDBA= sha256:dmisNPLh0qepmeETC4e575vL7ZkHU2p7JHui28n4EGA=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Tue, 12 Mar 2024 11:19 UTC

* Joerg Mertens <joerg-mertens@t-online.de>
| Alan Grunwald <nospam.nurdglaw@gmail.com> writes:
| > % oo::class create foo {constructor {a} {}}
| > ::foo
| > % set f [foo new]
| > ::oo::Obj12
| > % set f [foo new a b c]
| > ::oo::Obj13
| >
| > I'd expect both attempts to create objects to fail because neither
| > specifies the correct number of arguments.
| >
| > Have I misunderstood something (if so, what) or is there a bug here?
>
| Looks like the constructor is not even created if the body is empty. As
| soon as you put something in the body the arguments are checked:

Even an comment is sufficient to trigger this:

% oo::class create foo {constructor {} {#;}}
::foo
% set g [foo new a b c]
wrong # args: should be "foo new"

But I would file "not checking the arguments" under 'bug' anyway...

R'

Re: Something odd with [oo::class create] on Tcl 8.6.13

<usuhd1$1hjpd$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13551&group=comp.lang.tcl#13551

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Re: Something odd with [oo::class create] on Tcl 8.6.13
Date: Thu, 14 Mar 2024 09:52:26 +0000
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <usuhd1$1hjpd$1@dont-email.me>
References: <usn9u8$3mlci$1@dont-email.me>
<87jzm8whs2.fsf@jmertens.eternal-september.org>
<ygav85ry9xs.fsf@panther.akutech-local.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 14 Mar 2024 09:52:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ff8e4ba00359345dc673b616be86c919";
logging-data="1625901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0ZOnAQxWJkOY67Tq9eg/qW6pFNUbk1B8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:K1PDRPiUBVeisjUiRpLVAXn0hPc=
In-Reply-To: <ygav85ry9xs.fsf@panther.akutech-local.de>
Content-Language: en-US
 by: Alan Grunwald - Thu, 14 Mar 2024 09:52 UTC

On 12/03/2024 11:19, Ralf Fassel wrote:
> * Joerg Mertens <joerg-mertens@t-online.de>
> | Alan Grunwald <nospam.nurdglaw@gmail.com> writes:
> | > % oo::class create foo {constructor {a} {}}
> | > ::foo
> | > % set f [foo new]
> | > ::oo::Obj12
> | > % set f [foo new a b c]
> | > ::oo::Obj13
> | >
> | > I'd expect both attempts to create objects to fail because neither
> | > specifies the correct number of arguments.
> | >
> | > Have I misunderstood something (if so, what) or is there a bug here?
>>
> | Looks like the constructor is not even created if the body is empty. As
> | soon as you put something in the body the arguments are checked:
>
> Even an comment is sufficient to trigger this:
>
> % oo::class create foo {constructor {} {#;}}
> ::foo
> % set g [foo new a b c]
> wrong # args: should be "foo new"
>
> But I would file "not checking the arguments" under 'bug' anyway...
>
> R'

Thanks Joerg, Ralf. I didn't realise that the default constructor (if
none was specified) would accept an arbitrary number of arguments.

I'll raise a bug report about the differing behaviour between a
constructor with and without a body.

Alan

Re: Something odd with [oo::class create] on Tcl 8.6.13

<usuk1u$1i7q2$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13552&group=comp.lang.tcl#13552

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Re: Something odd with [oo::class create] on Tcl 8.6.13
Date: Thu, 14 Mar 2024 10:37:43 +0000
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <usuk1u$1i7q2$1@dont-email.me>
References: <usn9u8$3mlci$1@dont-email.me>
<87jzm8whs2.fsf@jmertens.eternal-september.org>
<ygav85ry9xs.fsf@panther.akutech-local.de> <usuhd1$1hjpd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 14 Mar 2024 10:37:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ff8e4ba00359345dc673b616be86c919";
logging-data="1646402"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ex/3RsUMOdHyXzxnt6eEArM412jzxyR4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:SFvqNPbXdDAI07Cfu2D7EWwN1io=
Content-Language: en-US
In-Reply-To: <usuhd1$1hjpd$1@dont-email.me>
 by: Alan Grunwald - Thu, 14 Mar 2024 10:37 UTC

On 14/03/2024 09:52, Alan Grunwald wrote:
> On 12/03/2024 11:19, Ralf Fassel wrote:
>> * Joerg Mertens <joerg-mertens@t-online.de>
>> | Alan Grunwald <nospam.nurdglaw@gmail.com> writes:
>> | >     % oo::class create foo {constructor {a} {}}
>> | >     ::foo
>> | >     % set f [foo new]
>> | >     ::oo::Obj12
>> | >     % set f [foo new a b c]
>> | >     ::oo::Obj13
>> | >
>> | > I'd expect both attempts to create objects to fail because neither
>> | > specifies the correct number of arguments.
>> | >
>> | > Have I misunderstood something (if so, what) or is there a bug here?
>>>
>> | Looks like the constructor is not even created if the body is empty. As
>> | soon as you put something in the body the arguments are checked:
>>
>> Even an comment is sufficient to trigger this:
>>
>>      % oo::class create foo {constructor {} {#;}}
>>      ::foo
>>      % set g [foo new a b c]
>>      wrong # args: should be "foo new"
>>
>> But I would file "not checking the arguments" under 'bug' anyway...
>>
>> R'
>
> Thanks Joerg, Ralf. I didn't realise that the default constructor (if
> none was specified) would accept an arbitrary number of arguments.
>
> I'll raise a bug report about the differing behaviour between a
> constructor with and without a body.
>
> Alan

I've raised ticket [7a0f53f4] in the core fossil repo - I hope that's
the right place.

In the course of reformulating the example, I discovered that a single
space is sufficient to cause he arguments to be checked.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor