Christoph
> How do I print() without appending a newline?
>
You don't.
Here is the C, \n is always appended after last arg:
gpsee_printf(cx, "%s%s%s", i ? " " : "", JS_GetStringBytes(str), i+1==argc?"\n":"");
73 de Jeff
How do I write to stdout then?
Wes Garland
21 September, 2011 11:12 AM
How do I write to stdout then?
require('system').stdout.write('hello, world');
Wes Garland
21 September, 2011 12:06 PM
MA MIA
Are you able to produce a reduced test case?
Christoph Dorn
21 September, 2011 11:53 AM
Wes Garland
21 September, 2011 12:06 PM
MA MIA
Are you able to produce a reduced test case?
Thanks for the bug report.
Based on your troubleshooting, I have a couple of ideas where this is hiding, will try to look at it relatively soon. Hopefully this reproduces easily for me. :)

Christoph
So yes print is "overrated" and MUSTHAVE for KISS design(as used in RPM and uglix pipes and stdout and …)
On 22 September 2011 12:14, Jeff Johnson <n3...@mac.com> wrote:So yes print is "overrated" and MUSTHAVE for KISS design(as used in RPM and uglix pipes and stdout and …)
Have you seen GPSEE's consume-and-yield pipelines? They're the first attempt at an idiom I am trying to use to replace | pipes. One key element is that they are implemented with generators, so we don't have get stuck with event-loop-paradigm and don't need to do something stupid like read the entire file in before we can deal with it.
Here is a completely contrived example:
CAY = require("shellalike").cay;
function NOP(pipeline)
{
for each (let line in pipeline)
yield line;
}
function killNL(pipeline)
{
for each (let line in pipeline)
yield line.substr(0,line.indexOf('\n'));
}
for (let line in CAY
("ls -l /etc/")
("sed 's/passwd/*** PASSWD ***/'")
("egrep -i '^t|ssw'")
(NOP)
(NOP)
(NOP)
(killNL)
){
print(line);
}
Not looked yet. What is of interest to me isHow to add RPMIO to bindings intelligently?
But just like POSIX, these are all synchronous interfaces, andO_NONBLOCK and aio(3) are too narrow to generalize nicely.
As a design paradigm, this means that consume-and-yield isn't the right solution:instead focus on the even dispatcher and registration, the other pieceswill fall into place as needed.
> I agree 100%, just teasing
>
Understood: just be careful with my fetishes please.
Just in case: I have a very dry sense of humor, don't take anything I say personally.
73 de Jeff