poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PROPOSAL] with_cur_ios() function in the stdlib


From: Mohammad-Reza Nabipoor
Subject: Re: [PROPOSAL] with_cur_ios() function in the stdlib
Date: Sun, 10 Apr 2022 17:52:35 +0430

On Sun, Apr 10, 2022 at 01:34:46PM +0200, Jose E. Marchesi wrote:
> I propose this:
> 
> with_cur_ios :ios ID :do lambda void: { ... }
> 
>   Will switch to the IOS ID (which is a descriptor) an execute the given
>   lambda.  It will guaranteed that upon exitting the lambda (in any way)
>   the previously selected IOS (if any) is restored.  This will not open
>   nor close any IO space.
> 
>   This doesn't get handler nor flags arguments obvioulsy.
> 
> with_temp_ios :handler "whatever" :do lambda void: { ... }
> 
>   Will _open_ an IOS based on `handler' (if the handler is not specified
>   it is a memory IOS with an unique name) and execute the lambda.  It is
>   guaranteed that upon exitting the lambda (in any way) the temporary
>   IOS gets closed and the previously selcted IOS (if any) is restored.
> 
> 
> And I think I agree with mnabipoor: it is best to have these functions
> in the standard library rather than in the run-time.
> 
> Thoughts?
> 
> 

I like this. More orthogonal. And both of them are useful in real-world.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]