hi,
i am just looking through the CHANGES file to find out what all the new stuff
is and try it out.
- the getter-setter example fails with:
getset.pike:4:Illegal ` identifier.
getset.pike:4:parse error, unexpected `TOK_IDENTIFIER', expecting `error' or `'(''
getset.pike:7:parse error, unexpected `TOK_RETURN'
getset.pike:10:Illegal ` identifier.
getset.pike:10:parse error, unexpected `TOK_IDENTIFIER', expecting `error' or `'(''
getset.pike:13:parse error, unexpected `'=''
getset.pike:14:…
[View More]parse error, unexpected `'}''
getset.pike:14:Missing ';'.
getset.pike:20:parse error, unexpected `'}''
getset.pike:20:Missing ';'.
getset.pike:26:parse error, unexpected `';'', expecting `')''
getset.pike:26:Missing ')'.
getset.pike:27:Missing ';'.
getset.pike:29:Missing '}'.
getset.pike:29:Unexpected end of file.
it looks almost like it is not working at all.
(i am using the pikefarm build to test this)
is there a switch that needs to be turned to activate this?
- does portable bytecode affect the performance?
did the dumped bytecode contain architecture specific optimizations before?
or were those always generated at runtime? in other words, where does the
machinecode generation come in?
- what is the missing example in ADT.Struct supposed to demonstrate?
- what do all these FIXME: Rewrite comments mean?
rewrite the code or rewrite the CHANGES entry?
greetings, martin.
[View Less]
I tried to use _typeof() to get the type of a function, but I found if a lambda function modified a var in the environ, the type "function" would be returned instead of "function(<arg type list>:<result type>)". for example:
# cat lambda.pike
void t(function f)
{
write("%O\n",_typeof(f));
}
void main()
{
int k;
t(lambda(int ig){});
t(lambda(int ig){k++;});
}
# pike lambda.pike
function(int : zero)
function
With second lambda function ,_typeof() just return "…
[View More]function", but for the first lambda it returned "function(int : zero)". The prototype of the two lambda function is SAME, then my question is "how can I get the prototype at runtime?"
[View Less]
Johan Sundström (Achtung Liebe!) @ Pike (-) developers forum
<10353(a)lyskom.lysator.liu.se> wrote:
> > If you don't have a PCRE enabled Pike, then there should be a solution
> > with Regexp(). But it seems like there's a little bug with $ on
> > Regexp(), but one bug at a time :)
>
> Not if it is the stone age Regexp(), as that one did/does not handle
> strings with null characters in it (except in cases where you really
> *want* it to treat \0 as end-of-…
[View More]string).
Interresting to know.
\0 could be replaced beforehand using replace(), then Regexp() used.
Even in this case, i guess we have a problem:
^ works:
----8<----8<----8<----8<----
> string bar = "oofoo";
> Regexp("^[o]+")->replace(bar, "");
(1) Result: "foo"
---->8---->8---->8---->8----
While $ seems not:
----8<----8<----8<----8<----
> Regexp("[o]+$")->replace(bar, "");
(2) Result: "f"
---->8---->8---->8---->8----
--
Bertrand LUPART
http://bertrand.gotpike.org/
[View Less]
Mirar @ Pike developers forum
<10353(a)lyskom.lysator.liu.se> wrote:
> >However, i'd like to know why while doing this:
> >----8<----8<----8<----8<----
> >> object r = Regexp.PCRE.Studied("[\\W]*$");
> >> r->replace(foo, "");
> >---->8---->8---->8---->8----
> >Pike eats all my CPU and the command never finish.
>
> Good question. The PCRE code should be easy to read though, feel free
> to investigate? :)
…
[View More]
When using n* (zero or more n), Regexp.PCRE._pcre()->exec() returns an
array of two identical int.
----8<----8<----8<----8<----
$ pike
Pike v7.6 release 112 running Hilfe v3.5 (Incremental Pike Frontend)
> Regexp.PCRE._pcre("o+")->exec("foobar",0);
(1) Result: ({ /* 2 elements */
1,
3
})
> Regexp.PCRE._pcre("o*")->exec("foobar",0);
(2) Result: ({ /* 2 elements */
0,
0
})
---->8---->8---->8---->8----
For each replace, Regexp.PCRE()->replace() attempts to execute the
regular expression at the end of the previous hit. It uses the return
from exec as a start and end offset.
Since the start and end offset returned by exec() are the same, this
results in a infinite loop.
----8<----8<----8<----8<----
$ pike
Pike v7.6 release 112 running Hilfe v3.5 (Incremental Pike Frontend)
> string foo = "foobar";
> Regexp.PCRE("o+")->replace(foo,"");
({ /* 2 elements */
1,
3
})
-1
(1) Result: "fbar"
> Regexp.PCRE("o*")->replace(foo,"");
({ /* 2 elements */
0,
0
})
({ /* 2 elements */
0,
0
})
({ /* 2 elements */
0,
0
})
({ /* 2 elements */
0,
0
})
... infinite loop ...
---->8---->8---->8---->8----
Please note that Regexp.PCRE()->matchall() obviously suffers from the
same problem:
----8<----8<----8<----8<----
$ pike
Pike v7.6 release 112 running Hilfe v3.5 (Incremental Pike Frontend)
> string foo = "foobar";
> Regexp.PCRE("o+")->matchall(foo, lambda(mixed s){ werror("%O\n",s); } );
({ /* 1 element */
"oo"
})
(1) Result: Regexp.PCRE.StudiedWidestring("o+")
> Regexp.PCRE("o*")->matchall(foo, lambda(mixed s){ werror("%O\n",s); } );
({ /* 1 element */
""
})
({ /* 1 element */
""
})
... infinite loop ...
---->8---->8---->8---->8----
I don't know which code should be fixed for now.
I don't understand the documentation for exec() when it returns an array
here:
<http://pike.ida.liu.se/generated/manual/modref/ex/predef_3A_3A/Regexp/P
CRE/_pcre/exec.html>
--
Bertrand LUPART
http://bertrand.gotpike.org/
[View Less]
Is there a way to force strong type checking with pike (7.4)?
It seems that I can pass an int to a method that requires a string and
assign an int to a string variable.
Coen
__________________________________________________________
Deze e-mail en de inhoud is vertrouwelijk en uitsluitend bestemd voor de geadresseerde(n). Indien u niet de geadresseerde bent van deze e-mail verzoeken wij u dit direct door te geven aan de verzender door middel van een reply e-mail en de ontvangen e-mail uit …
[View More]uw systemen te verwijderen. Als u geen geadresseerde bent, is het niet toegestaan om kennis te nemen van de inhoud, deze te kopieren, te verspreiden, bekend te maken aan derden noch anderszins te gebruiken.
The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Please notify us immediately if you have received it in error by reply e-mail and then delete this message from your system.
__________________________________________________________
[View Less]
2
1
utime
by Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
16 Apr '08
16 Apr '08
There is a
#ifdef _UTIMBUF_DEFINED
struct _utimbuf b;
#else
struct utimbuf b;
#endif
in system.c, but I don't see anything that could define _UTIMBUF_DEFINED.
Mirar @ Pike developers forum
<10353(a)lyskom.lysator.liu.se> wrote:
> >However, i'd like to know why while doing this:
> >----8<----8<----8<----8<----
> >> object r = Regexp.PCRE.Studied("[\\W]*$");
> >> r->replace(foo, "");
> >---->8---->8---->8---->8----
> >Pike eats all my CPU and the command never finish.
>
> Good question. The PCRE code should be easy to read though, feel free
> to investigate? :)
…
[View More]
I just like other people confirm that's a real bug :)
> Sounds like something that should be added to the testsuite, anyway.
> Both of the problems...
I inadvertendly found out that replace1() succeed where replace()
failed:
----8<----8<----8<----8<----
$ pike
Pike v7.6 release 112 running Hilfe v3.5 (Incremental Pike Frontend)
> string foo = " This is some text \0\0\0";
> object r = Regexp.PCRE.Studied("[\\W]*$");
> r->replace1(foo, "");
(1) Result: " This is some text"
---->8---->8---->8---->8----
Should be a good start to narrow down the problem.
--
Bertrand LUPART
http://bertrand.gotpike.org/
[View Less]
(using pike 7.4 r464)
I want to replace something at the end of a string, but I can't get it done:
I don't know the exact contents of the string when executing code, mind
you.
string test = "aaa123aaa";
Regex re = Regex("[a]$");
string result = re->replace(test,"");
results in: "123b" while I want it to be 'aaa123'.
using "^[a]" results in "123aaa".
What am I doing wrong?
Eventually I want to convert a string like " This is some text
\0\0\0" to " This is some text".
Greets,…
[View More]
Coen
__________________________________________________________
Deze e-mail en de inhoud is vertrouwelijk en uitsluitend bestemd voor de geadresseerde(n). Indien u niet de geadresseerde bent van deze e-mail verzoeken wij u dit direct door te geven aan de verzender door middel van een reply e-mail en de ontvangen e-mail uit uw systemen te verwijderen. Als u geen geadresseerde bent, is het niet toegestaan om kennis te nemen van de inhoud, deze te kopieren, te verspreiden, bekend te maken aan derden noch anderszins te gebruiken.
The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Please notify us immediately if you have received it in error by reply e-mail and then delete this message from your system.
__________________________________________________________
[View Less]
hi,
anyone noticed this yet?
http://code.google.com/p/pike-cms/
might be good to tell those guys that their name and the use of the pike tag is
very missleading.
greetings, martin.