What is the difference with the two following examples for bar?
1) Foo.pmod/bar.pike 2) Foo.pmod/bar.pmod
bar is a file in both cases, and Foo is somewhere where pike finds it.
And asking about modules, pike --help=environment mentions a program path. When is the program path used? For what?
Thanks!
Foo.pmod/bar.pike
will make Foo.bar a program that you will have to instansiate with Foo.bar() to use.
Foo.pmod/bar.pmod
will make Foo.bar an object.
The program path is the path were progams are searched for when you do
inherit "name";
Not a very useful feature...
/ Martin Nilsson (DivX Networks)
Previous text:
2004-08-28 15:27: Subject: pike modules
What is the difference with the two following examples for bar?
- Foo.pmod/bar.pike
- Foo.pmod/bar.pmod
bar is a file in both cases, and Foo is somewhere where pike finds it.
And asking about modules, pike --help=environment mentions a program path. When is the program path used? For what?
Thanks!
/ Brevbäraren
Ah, ok. Thanks :)
Martin Nilsson (DivX Networks) @ Pike (-) developers forum wrote:
Foo.pmod/bar.pike
will make Foo.bar a program that you will have to instansiate with Foo.bar() to use.
Foo.pmod/bar.pmod
will make Foo.bar an object.
The program path is the path were progams are searched for when you do
inherit "name";
Not a very useful feature...
/ Martin Nilsson (DivX Networks)
Previous text:
2004-08-28 15:27: Subject: pike modules
What is the difference with the two following examples for bar?
- Foo.pmod/bar.pike
- Foo.pmod/bar.pmod
bar is a file in both cases, and Foo is somewhere where pike finds it.
And asking about modules, pike --help=environment mentions a program path. When is the program path used? For what?
Thanks!
/ Brevbäraren
Related question:
How does one implement pmod-like things using CMOD? Just add functions without a PIKECLASS wrapper?
/ Marcus Agehall (PacketFront)
Previous text:
2004-08-28 17:42: Subject: Re: pike modules
Ah, ok. Thanks :)
Martin Nilsson (DivX Networks) @ Pike (-) developers forum wrote:
Foo.pmod/bar.pike
will make Foo.bar a program that you will have to instansiate with Foo.bar() to use.
Foo.pmod/bar.pmod
will make Foo.bar an object.
The program path is the path were progams are searched for when you do
inherit "name";
Not a very useful feature...
/ Martin Nilsson (DivX Networks)
Previous text:
2004-08-28 15:27: Subject: pike modules
What is the difference with the two following examples for bar?
- Foo.pmod/bar.pike
- Foo.pmod/bar.pmod
bar is a file in both cases, and Foo is somewhere where pike finds it.
And asking about modules, pike --help=environment mentions a program path. When is the program path used? For what?
Thanks!
/ Brevbäraren
/ Brevbäraren
Is there also a way in which I can place constant functions anywhere I like in the namespace from a single file? Ie create the constant function Foo.Bar.Gazonk() from the file Foo.cmod?
/ Marcus Agehall (PacketFront)
Previous text:
2004-08-29 02:32: Subject: Re: pike modules
Yep.
/ Martin Nilsson (DivX Networks)
Overload indexing of the object.
/ Martin Nilsson (DivX Networks)
Previous text:
2004-08-30 08:13: Subject: Re: pike modules
Is there also a way in which I can place constant functions anywhere I like in the namespace from a single file? Ie create the constant function Foo.Bar.Gazonk() from the file Foo.cmod?
/ Marcus Agehall (PacketFront)
Perhaps it's time to create an FAQ at the pike-site. The standard answer to all questions without explicit answer can be "Overload the index operator". ;)
IMHO, overloading the index operator is not always an option. I thinkt it's a way to powerful thing in most cases. I would really like to see some way of adding constants (and programs) anywhere (within a branch) in the namespace. Is there some good reason why this cannot be implemented?
/ Marcus Agehall (PacketFront)
Previous text:
2004-08-30 12:44: Subject: Re: pike modules
Overload indexing of the object.
/ Martin Nilsson (DivX Networks)
It would just be a matter of supporting the syntax
mixed Bar.Gazonk() { ... }
and accept that it may take way longer to resolve than the normal way. But then you would have to touch the resolver, and if you do you will be eternally responsible for fixing all the bugs in it.
/ Martin Nilsson (DivX Networks)
Previous text:
2004-08-30 12:48: Subject: Re: pike modules
Perhaps it's time to create an FAQ at the pike-site. The standard answer to all questions without explicit answer can be "Overload the index operator". ;)
IMHO, overloading the index operator is not always an option. I thinkt it's a way to powerful thing in most cases. I would really like to see some way of adding constants (and programs) anywhere (within a branch) in the namespace. Is there some good reason why this cannot be implemented?
/ Marcus Agehall (PacketFront)
Ouch. Not beeing eternally resposible for the resolver is a good reason not to implement it. ;)
/ Marcus Agehall (PacketFront)
Previous text:
2004-08-30 12:53: Subject: Re: pike modules
It would just be a matter of supporting the syntax
mixed Bar.Gazonk() { ... }
and accept that it may take way longer to resolve than the normal way. But then you would have to touch the resolver, and if you do you will be eternally responsible for fixing all the bugs in it.
/ Martin Nilsson (DivX Networks)
Overloading `-> gives a lot of problems, mainly for the poor sods who try to inherit the class. I'd only do it for classes that should behave like a mapping. In all other cases I'd think at least twice if there's another way to do it.
/ Martin Stjernholm, Roxen IS
Previous text:
2004-08-30 12:48: Subject: Re: pike modules
Perhaps it's time to create an FAQ at the pike-site. The standard answer to all questions without explicit answer can be "Overload the index operator". ;)
IMHO, overloading the index operator is not always an option. I thinkt it's a way to powerful thing in most cases. I would really like to see some way of adding constants (and programs) anywhere (within a branch) in the namespace. Is there some good reason why this cannot be implemented?
/ Marcus Agehall (PacketFront)
Make an efun and assign it to a constant in the class, like String.width.
/ Martin Stjernholm, Roxen IS
Previous text:
2004-08-30 08:13: Subject: Re: pike modules
Is there also a way in which I can place constant functions anywhere I like in the namespace from a single file? Ie create the constant function Foo.Bar.Gazonk() from the file Foo.cmod?
/ Marcus Agehall (PacketFront)
pike-devel@lists.lysator.liu.se