replace
by Mirar @ Pike developers forum
28 Oct '09
28 Oct '09
why do
> replace(({1,2,3}),2,17);
(6) Result: ({ /* 3 elements */
1,
17,
3
})
work, while
> replace(({1,2,3}),({2}),({17}));
(5) Result: ({ /* 3 elements */
1,
2,
3
})
does nothing?
4
5
release
by Peter Bortas @ Pike developers forum
22 Oct '09
22 Oct '09
It's time to do a stable release again. If you have low risk but
potentially build breaking code in the pipe then check it in now. I'll
aim for a release next week.
1
0
pcvs2git.pike
by Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
19 Oct '09
19 Oct '09
The above file is now available via git://pike-git.lysator.liu.se/pcvs2git.git/
Note: Requires rcs (and git).
Note that the tool is by no means finished, but it seems to generate
an acceptable git archive from the repositories that I've tested with.
Caveat emptor: I've not tested with any repositories larger than the
Pike 0.5 repository yet (~7000 file revisions).
In the following case the optimizer seems to assume, that the array does
not change during the loop and optimizes away the sizeof check:
int main() {
array a = ({ 1, 2, 3, 4, 5 });
void magic(int k) {
a = a[0..k-1] + a[k+1..];
};
for (int i = 0; i < sizeof(a); i++) {
if (a[i] == 2) {
magic(i);
i--;
}
}
return 0;
}
I assume cases like this are hard to detect, especially because
this can me made even more complicated. I will put in some
if (0) { ret = ({});}
equivalent to trick the optimizer for now.
arne
Just thought I'd post a reminder that a number of Pike devotees will be in
Copenhagen for a few days this month (at least the 24th and 25th, I'll be
there a day before and after, as well). We'll probably having all kinds of
conversations, and it coincides with Open Source Days, so a few of us will
be manning a "booth" and doing presentations. We always have some good
conversations and cool things often sprout from them, and new faces (and
old friends, of course) are always welcome.
I'm told that Denmark is relatively close for folks in Scandanavia, so do
consider coming down for a visit if you're in the region!
For more details, drop myself or our man-on-the-ground, Matt Hardy
(matt(a)webhaven.eu) a line.
Best,
Bill
1
0
deprecated on operators
by Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
04 Oct '09
04 Oct '09
Given
RCS file: /pike/data/cvsroot/Pike/7.8/src/modules/files/file_functions.h,v
retrieving revision 1.47
diff -r1.47 file_functions.h
124c124
< FILE_FUNC("`<<",file_lsh, tFunc(tMixed,FILE_OBJ))
---
> FILE_FUNC("`<<",file_lsh, tAttr("deprecated", tFunc(tMixed,FILE_OBJ)))
I get
Pike v7.8 release 349 running Hilfe v3.5 (Incremental Pike Frontend)
> Stdio.File f = Stdio.File("zork","cwt");
> f<<"hej";
(1) Result: Fd(10)
> f->`<<("hopp");
Compiler Warning: 1: Calling a deprecated value.
Compiler Warning: 1: Using deprecated object(implements _static_modules.files()->Fd_ref) value.
(2) Result: Fd(10)
Would it be hard to improve?
The Pike developers are proud to present Pike 7.8.316, a new stable
release.
Download from
http://pike.ida.liu.se/download/pub/pike/latest-stable/
Changes since Pike 7.8.316 (second 7.8 release):
----------------------------------------------------------------------
General
-------
o ADT.Heap
The compat functions top() and size() are now marked as deprecated.
Extensions and New Functions
----------------------------
o Image.Image
Added support for sending Color objects to the color() function.
o Sql.Sql
Added support for fetching result sets as JSON-encoded strings.
o Calendar
Updated timezone data to 2009j.
o Parser.XML.Tree
Output from render_xml() is now on canonical form.
o Added "pike -x httpserver" that implements a minimal HTTP-server
exporting the current directory.
Optimizations
-------------
o Lowered startup time by extending encode_value() and MasterCodec so
that master.pike can be precompiled.
o Lowered startup time by reducing the number of MEMSET() calls done
on startup.
o Allow threads while calling SDL_GL_SwapBuffers.
o Added optimization of has_value() and search() for single-character strings.
o Added optimization when combining two arrays where the second array
contains a single item.
Bug fixes
---------
o Fixed casting of floats to strings to again work more like in Pike
7.6 and earlier: The string will always contain either a "." or an
"e" to signify that it is a float, and it will no longer display so
many digits that the binary/decimal conversion errors become
visible.
o Protocols.HTTP.Server.HeaderParser will now discard parts of a
header value if the header value contains a newline (like "Host:
google.com\n.hax.net\r\n") and headers without colon.
o file_open_socket() now attempts to set SO_REUSEPORT on the socket.
Potentially fixes issues on FreeBSD 7.x where ports aren't reused.
o Calendar.TimeRanges now knows that `+() and `-() can get any number
of arguments.
o The experimental extended ZFS support is disabled since it pulled in
unwanted dependencies.
o Fixed propagation of changed module directories for joinnodes by
zapping the joinnode cache.
o Fixed memory leak in Image.WBF.
o Fixed potential NULL-deref in Image.XWD.
o Fixed potential NULL-deref in Image.PNG.
Building and installing
-----------------------
o Nettle 2.0 is now supported.
2
2
Bundles
by Magnus Holmgren, Millnet/Lysator/Debian/Mensa @ Pike developers forum
23 Sep '09
23 Sep '09
To avoid freeness issues etc., I would be very happy if there were a
variant of the Pike source tarball without bundled libraries. From
debian/copyright:
> The upstream tarball has been repacked without the 'bundles'
> subdirectory, which contains redundant copies of some libraries, to
> avoid shipping some non-DFSG-compliant bits (see the gmp package)
> and having to include the copyright information and licenses of
> those libraries.
In any case, why is there both a libffi-3.0.4.tar.gz and its unpacked
contents?
New build that I hope to release as a stable towards the end of the
week:
http://pike.ida.liu.se/download/pub/pike/beta/7.8.346/
Windows build avilable.
Changes since Pike 7.8.316 (second stable 7.8 release):
-------------------------------------------------------
General
-------
o ADT.Heap
The compat functions top() and size() are now marked as deprecated.
Extensions and New Functions
----------------------------
o Image.Image
Added support for sending Color objects to the color() function.
o Sql.Sql
Added support for fetching result sets as JSON-encoded strings.
o Calendar
Updated timezone data to 2009j.
o Added "pike -x httpserver" that implements a minimal HTTP-server
exporting the current directory.
Optimizations
-------------
o Lowered startup time by extending encode_value() and MasterCodec so
that master.pike can be precompiled.
o Lowered startup time by reducing the number of MEMSET() calls done
on startup.
o Allow threads while calling SWL_GL_SwapBuffers.
o Added optimization of has_value() and search() for single-character strings.
o Added optimization when combining two arrays where the second array
contains a single item.
Bug fixes
---------
o Fixed casting of floats to strings to again work more like in Pike
7.6 and earlier: The string will always contain either a "." or an
"e" to signify that it is a float, and it will no longer display so
many digits that the binary/decimal conversion errors become
visible.
o Protocols.HTTP.Server.HeaderParser will now discard parts of a
header value if the header value contains a newline (like "Host:
google.com\n.hax.net\r\n") and headers without colon.
o file_open_socket() now attepts to set SO_REUSEPORT on the socket.
Potentially fixes issues on FreeBSD 7.x where ports aren't reused.
o Calendar.TimeRanges now knows that `+() and `-() can get any number
of arguments.
o The experimental extended ZFS support is disabled since it pulled in
unwanted dependencies.
o Fixed propagation of changed module directories for joinnodes by
zapping the joinnode cache.
o Fixed memory leak in Image.WBF.
o Fixed potential NULL-deref in Image.XWD.
o Fixed potential NULL-deref in Image.PNG.
Building and installing
-----------------------
o Nettle 2.0 is now supported.
In various parts of my code I wish to remove a set of indices from a
mapping. According to the documentation the index to be removed can be a
mixed type, so it seems I can only remove indices from a mapping by
performing m_delete's one-by-one.
Code like:
array removable_indices = ({ "a", "b", "c" });
mapping data = ([ "a" : "A", "b" : "B", "d" : "D" ]);
m_delete(data, removable_indices);
will not have the same result as removing indices "a", "b" and "c"
through three separate m_delete statements.
Is there a way to tell pike I wish to delete a list of indices, allowing
pike to maybe perform such an operation more efficient than through
separate statements? Or any chance such a statement or syntax might
appear in the future?
(Hmmmm, I haven't checked m_delete(data, @removable_indices); )
Regards,
Arjan