David,

Back around April 20, Roland M spec'd out an lseek proposal
and wondered how best to return the seek value.

I simply suggested the use of a call-by-name argument.
Then out of the blue today, someone asked how that would work, so I replied
to them.

While I don't have any current interest in seek'ing, your new operators
are very cool. But I am *wildly* enthusiastic about call-by-name *grin*.

Cheers,
   Mario

David Korn wrote:

> 
>>If lseek is external, that I would suggest a ksh builtin wrapper around it.
>>Personally I would like to see an expansion of the use of call-by-name
>>argument passing.
>>
>>
> 
> 
> 
> Here is an example of call by name argument passing:
> 
> ================cut here=====================
> function distance
> {
>       nameref p=$1
>       print -- $(( sqrt(p.x*p.x + p.y*p.y) ))
> }
> 
> p1=(float x=3 y=4)
> p2=(float x=5 y=12)
> distance p1
> distance p2
> ================cut here=====================
> The output is
> 5
> 13
> 
> 
> I don't know what this has to do with lseek.
> As I reported earlier, there is no need for an lseek builtin
> since ksh93r has the ability to seek as part of the language.
> 
> The new redirection operators, <# and ># are used to seek.
> For example,
>       <# (( EOF-36))
> will seek to 36 bytes before the end-of-file.  You can apply this
> along with any redirection so that
>       cat < file <# ((80))
> will cat the file starting from offset 80.
> The value of $(n<#) is the current offset on file descriptor <n>.
> 
> The current syntax can be extended to add other seek options like
> SEEK_HOLE, by using,
>       <# (( HOLE))
> to seek to the next hole.
>       
> 
> 
> David Korn
> dgk at research.att.com
> _______________________________________________
> ksh93-integration-discuss mailing list
> ksh93-integration-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss

Reply via email to