dexen deVries <dexen.devr...@gmail.com>
writes:

> On Saturday 08 October 2011 15:11:57 you wrote:
>> So maybe I should treat PicoLisp as a POSIX app and make my life easy
>> by just using "/dev/null" ;)
>> Would that be considered 'robust'?
>
> Perhaps it'd be easier to supply a hacked version of `out' on Windows,
> made to recognized "/dev/null" as special case. Just like you can, for
> example, use "/" as path separator in a lot of Windows apps.

I don't know C, but (without really understanding the code) I guess that
somewhere in 'pushOutFiles' there must be inserted a 

,---------------------------------------------------
| if (OS equals Windows && any equals "/dev/null") {
| ... send to "NULL" ...                            
| } else { ... as is ...}                           
`---------------------------------------------------

for a hacked version of 'out'. Unfortunately, I'm not quite sure where,
and how to do that right in C. 

// from io.c
,-----------------------------------
| // (out 'any . prg) -> any        
| any doOut(any ex) {               
|    any x;                         
|    outFrame f;                    
|                                   
|    x = cdr(ex),  x = EVAL(car(x));
|    wrOpen(ex, x, &f);             
|    pushOutFiles(&f);              
|    x = prog(cddr(ex));            
|    popOutFiles();                 
|    return x;                      
| }                                 
`-----------------------------------
// from io.c
,------------------------------------------------
| void pushOutFiles(outFrame *f) {               
|    OutFile = OutFiles[f->fd];                  
|    f->put = Env.put,  Env.put = putStdout;     
|    f->link = Env.outFrames,  Env.outFrames = f;
| }                                              
`------------------------------------------------

Cheers
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to