Deutsch   English   Français   Italiano  
<nnd$274f6c32$10db022f@ea48fe6bf4bc59ed>

View for Bookmarking (what is this?)
Look up another Usenet article

Date: Wed, 21 Aug 2024 19:12:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: portable or not? Volatile strings
Newsgroups: comp.lang.forth
References: <nnd$3d18fe02$76aace5d@9eae9618ab09b239>
 <v9ch3d$364en$2@dont-email.me> <nnd$270fe830$0d1a89f2@3c40938332b986e6>
 <v9crjs$364en$5@dont-email.me> <nnd$43b12c93$7f618144@18dd570284c2b77b>
 <66badc17$1@news.ausics.net>
Content-Language: en-US
From: Hans Bezemer <the.beez.speaks@gmail.com>
In-Reply-To: <66badc17$1@news.ausics.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <nnd$274f6c32$10db022f@ea48fe6bf4bc59ed>
Organization: KPN B.V.
Path: ...!weretis.net!feeder9.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feed.abavia.com!abe004.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 52
Injection-Date: Wed, 21 Aug 2024 19:12:36 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
Bytes: 2397

On 13-08-2024 06:07, dxf wrote:
> On 13/08/2024 5:34 am, albert@spenarnc.xs4all.nl wrote:
>> ...
>> In my book the code should be
>>
>>                          "        "
>>                          "######  "
>>                          "  ##    "
>>                          "        "
>> DEF-BRICK BRICK1
>>
>> Instead of
>>
>> DEF-BRICK BRICK1        S"         "
>>                          S" ######  "
>>                          S"   ##    "
>>                          S"         "
>>
>> The code (untested) could be
>> : DEF-BRICK CREATE
>>      2>R 2>R 2>R 2>R
>>      2R> ,, 2R> ,, 2R> ,, 2R> ,,
>>   DOES>  ... ;
> 
> OTOH it's no less difficult to write...
> 
> : M"  [CHAR] " PARSE  HERE  OVER ALLOT  SWAP MOVE ;
> 
> : DEF-BRICK  CREATE  DOES>  ROT 4 * ROT + 2* CHARS + ;
> 
> DEF-BRICK BRICK1         M"         "
>                           M" ######  "
>                           M"   ##    "
>                           M"         "
> 

In 4tH, the easiest solution would be:

: BRICK@ ROT + @C SWAP 2* CHARS + ;

CREATE BRICK1
   ,"         "
   ," ######  "
   ,"   ##    "
   ,"         "
DOES> BRICK@ ;

I could throw a bit of preprocessor magic in the mix, so it would 
resemble your solution even closer, but I guess you can do without ;-)

Hans Bezemer