Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

I'm still waiting for the advent of the computer science groupie.


devel / comp.lang.forth / HELD

SubjectAuthor
* HELDdxf
`* Re: HELDmhx
 `* Re: HELDdxf
  `* Re: HELDmhx
   `* Re: HELDdxf
    `- Re: HELDdxf

1
HELD

<6629b2dd$1@news.ausics.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=26774&group=comp.lang.forth#26774

  copy link   Newsgroups: comp.lang.forth
Date: Thu, 25 Apr 2024 11:33:18 +1000
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Newsgroups: comp.lang.forth
Content-Language: en-GB
From: dxforth@gmail.com (dxf)
Subject: HELD
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <6629b2dd$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 14
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: dxf - Thu, 25 Apr 2024 01:33 UTC

This is a new word introduced by MPE. It avoids some of the complications when
using #> to return the current contents of the PNO buffer. The definition is:

HELD ( -- caddr len )

Return the address and length of the string held in the pictured numeric output
buffer.

HELD is a factor of #> allowing the latter to be defined:

: #> 2DROP HELD ;

So if you've found yourself writing 0 0 #> or <# 2DUP HOLDS #> to avoid the
2DROP built into #> then HELD may be a neater solution.

Re: HELD

<77c5711d42106167e3af68b6d9909b02@www.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=26775&group=comp.lang.forth#26775

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: mhx@iae.nl (mhx)
Newsgroups: comp.lang.forth
Subject: Re: HELD
Date: Thu, 25 Apr 2024 06:35:48 +0000
Organization: novaBBS
Message-ID: <77c5711d42106167e3af68b6d9909b02@www.novabbs.com>
References: <6629b2dd$1@news.ausics.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2293691"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t0bSWFIQDvYvkkhDiPIIv6byulC6WbSEwXWMJpxc4k0";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 59549e76d0c3560fb37b97f0b9407a8c14054f24
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$3fj72ad5kD5Mwvkq9MPudOVjBDt.WX9EjJLyVQtel51J9zgkwrTnq
 by: mhx - Thu, 25 Apr 2024 06:35 UTC

dxf wrote:

> This is a new word introduced by MPE. It avoids some of the complications when
> using #> to return the current contents of the PNO buffer. The definition is:

> HELD ( -- caddr len )

> Return the address and length of the string held in the pictured numeric output
> buffer.

> HELD is a factor of #> allowing the latter to be defined:

> : #> 2DROP HELD ;

> So if you've found yourself writing 0 0 #> or <# 2DUP HOLDS #> to avoid the
> 2DROP built into #> then HELD may be a neater solution.

Doesn't everybody use the low level factors of "." etc.? Wanting to format
a number in a special way is rather infrequent, but not wanting to print a
number right away is common.

25 (.) TYPE
PI (F.) TYPE

-marcel

-marcel

Re: HELD

<662a0770$1@news.ausics.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=26776&group=comp.lang.forth#26776

  copy link   Newsgroups: comp.lang.forth
Date: Thu, 25 Apr 2024 17:34:10 +1000
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: HELD
Newsgroups: comp.lang.forth
References: <6629b2dd$1@news.ausics.net>
<77c5711d42106167e3af68b6d9909b02@www.novabbs.com>
Content-Language: en-GB
From: dxforth@gmail.com (dxf)
In-Reply-To: <77c5711d42106167e3af68b6d9909b02@www.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <662a0770$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 23
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: dxf - Thu, 25 Apr 2024 07:34 UTC

On 25/04/2024 4:35 pm, mhx wrote:
> ...
> Doesn't everybody use the low level factors of "." etc.? Wanting to format
> a number in a special way is rather infrequent, but not wanting to print a
> number right away is common.
> 25 (.)  TYPE
> PI (F.) TYPE

(F.) is an example of where I used HELD two or three times. Some others:

\ Return string right-aligned as a2 u2. Uses HOLD buffer
: RJUST ( a u +n c -- a2 u2 )
>r >r <# shold held r> over - 0 max r> nhold #> ;

\ Get the full directory path for logical disk drive u
: PATH ( u -- c-addr u2 ior )
zbuf @ 2dup 'SI ! 'DX c! $47 doscall doserr? >r
<# zcount dup if [char] \ hold then shold s" :\\" shold
>drv [char] A + hold held r> ;

HOLDS (200x) recognizes that the numeric conversion buffer can and is used for
string processing. In that situation HELD is often more appropriate than #> .

Re: HELD

<728cd8ab5d148a189a1eb66b604d853b@www.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=26778&group=comp.lang.forth#26778

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: mhx@iae.nl (mhx)
Newsgroups: comp.lang.forth
Subject: Re: HELD
Date: Thu, 25 Apr 2024 10:51:40 +0000
Organization: novaBBS
Message-ID: <728cd8ab5d148a189a1eb66b604d853b@www.novabbs.com>
References: <6629b2dd$1@news.ausics.net> <77c5711d42106167e3af68b6d9909b02@www.novabbs.com> <662a0770$1@news.ausics.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2312225"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t0bSWFIQDvYvkkhDiPIIv6byulC6WbSEwXWMJpxc4k0";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 59549e76d0c3560fb37b97f0b9407a8c14054f24
X-Rslight-Site: $2y$10$r2EtsUJpyIQu6QIX/FNk8OHwjxoCSSQ4idfpcuBhzXSMdcEqtwATW
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: mhx - Thu, 25 Apr 2024 10:51 UTC

dxf wrote:

[..]
> (F.) is an example of where I used HELD two or three times. Some others:

> \ Return string right-aligned as a2 u2. Uses HOLD buffer
> : RJUST ( a u +n c -- a2 u2 )
> >r >r <# shold held r> over - 0 max r> nhold #> ;
[..]
> HOLDS (200x) recognizes that the numeric conversion buffer can and is used for
> string processing. In that situation HELD is often more appropriate than #> .

I was never really satisfied with this low-level assembly work.
Nowadays I use device redirection to a string, for example:

: dd>matlab ( F: sel -- ) ( -col -- c-addr u )
FLOCAL sel
LOCAL -col
|resudata 0= IF S" >matlab :: ERROR :: TASK-DATA is unavailable." EXIT ENDIF
<$$ ." %% iSPICE output" CR ." % "
#|params 0 ?DO I -col <> IF |head .pnames I CSTR[] .$ .FOURTABS
ENDIF
LOOP
#|results 0 ?DO I >headrow .resname .$ .FOURTABS LOOP
CR ." data = ["
#|tasks
0 ?DO -col 0> IF |head .paramdata I #|params * -col +
DFLOAT[] DF@ sel -1e-4 F~ ( equal to 0.01% )
ELSE TRUE
ENDIF
IF CR #|params 0 ?DO I -col
<> IF |head .paramdata
J #|params * I +
DFLOAT[] DF@ +E. 3 SPACES
ENDIF
LOOP
#|results 0 ?DO |resudata J #|results * I +
DFLOAT[] DF@ +E. 3 SPACES
LOOP
ENDIF
LOOP
CR ." ];"
CR
$$> ;

: .JOB>console ( -- ) 0e -1 dd>matlab TYPE ;
: .JOB>matlab ( -- ) 0e -1 dd>matlab MFILE-NAME DUMP-TO-FILE ;

-marcel

Re: HELD

<662a471a$1@news.ausics.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=26779&group=comp.lang.forth#26779

  copy link   Newsgroups: comp.lang.forth
Date: Thu, 25 Apr 2024 22:05:47 +1000
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: HELD
Newsgroups: comp.lang.forth
References: <6629b2dd$1@news.ausics.net>
<77c5711d42106167e3af68b6d9909b02@www.novabbs.com>
<662a0770$1@news.ausics.net>
<728cd8ab5d148a189a1eb66b604d853b@www.novabbs.com>
Content-Language: en-GB
From: dxforth@gmail.com (dxf)
In-Reply-To: <728cd8ab5d148a189a1eb66b604d853b@www.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <662a471a$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 19
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: dxf - Thu, 25 Apr 2024 12:05 UTC

On 25/04/2024 8:51 pm, mhx wrote:
> dxf wrote:
>
> [..]
>> (F.) is an example of where I used HELD two or three times.  Some others:
>
>> \ Return string right-aligned as a2 u2. Uses HOLD buffer
>> : RJUST ( a u +n c -- a2 u2 )
>>   >r >r  <# shold held  r> over - 0 max  r> nhold #> ;
> [..]
>> HOLDS (200x) recognizes that the numeric conversion buffer can and is used for
>> string processing.  In that situation HELD is often more appropriate than #> .
>
> I was never really satisfied with this low-level assembly work. Nowadays I use device redirection to a string, for example:
> ...

Well-factored code has a simplicity and a rightness to it. When one sees
something that irreducible, all the other machinations go out the window.

Re: HELD

<662b3650$1@news.ausics.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=26784&group=comp.lang.forth#26784

  copy link   Newsgroups: comp.lang.forth
Date: Fri, 26 Apr 2024 15:06:24 +1000
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: HELD
Newsgroups: comp.lang.forth
References: <6629b2dd$1@news.ausics.net>
<77c5711d42106167e3af68b6d9909b02@www.novabbs.com>
<662a0770$1@news.ausics.net>
<728cd8ab5d148a189a1eb66b604d853b@www.novabbs.com>
<662a471a$1@news.ausics.net>
Content-Language: en-GB
From: dxforth@gmail.com (dxf)
In-Reply-To: <662a471a$1@news.ausics.net>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <662b3650$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 25
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: dxf - Fri, 26 Apr 2024 05:06 UTC

On 25/04/2024 10:05 pm, dxf wrote:
> On 25/04/2024 8:51 pm, mhx wrote:
>> dxf wrote:
>>
>> [..]
>>> (F.) is an example of where I used HELD two or three times.  Some others:
>>
>>> \ Return string right-aligned as a2 u2. Uses HOLD buffer
>>> : RJUST ( a u +n c -- a2 u2 )
>>>   >r >r  <# shold held  r> over - 0 max  r> nhold #> ;
>> [..]
>>> HOLDS (200x) recognizes that the numeric conversion buffer can and is used for
>>> string processing.  In that situation HELD is often more appropriate than #> .
>>
>> I was never really satisfied with this low-level assembly work. Nowadays I use device redirection to a string, for example:
>> ...
>
> Well-factored code has a simplicity and a rightness to it. When one sees
> something that irreducible, all the other machinations go out the window.

Regarding redirection I'd say apps intended for disk output are written that
way which implies functions have string output. If OTOH apps are written
for console output, then usually the OS has a mechanism for redirection in
which case the app writer need not concern himself.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor