Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #52115

The implementation of S, in GForth

Newsgroups comp.lang.forth
Date 2016-10-22 06:55 -0700
Message-ID <06a5cb83-da91-4b38-a0ea-e38508ed8aee@googlegroups.com> (permalink)
Subject The implementation of S, in GForth
From lehs <skydda.barnen@gmail.com>

Show all headers | View raw


In GForth  S,  is implemented with an final align

see s,
: S, 
  here noop 1+ allot place align ; ok

that seems unnecessary. Suppose you want to store several counted strings in the same array, then there would be an easy way to recall the i:th string in the array by

: nextword \ ad -- ad'
  dup c@ + 1+ ;

: word# \ array i -- ad n
  over @ mod 0 
  rot cell+ -rot
  ?do nextword loop count ;

if the strings would have been stored without trailing blanks. 
So why this ALIGN?

Back to comp.lang.forth | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

The implementation of S, in GForth lehs <skydda.barnen@gmail.com> - 2016-10-22 06:55 -0700
  Re: The implementation of S, in GForth "HAA" <someone@microsoft.com> - 2016-10-23 16:44 +1000
  Re: The implementation of S, in GForth Doug Hoffman <glidedog@gmail.com> - 2016-10-23 05:08 -0400
    Re: The implementation of S, in GForth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-10-23 18:03 +0200
  Re: The implementation of S, in GForth lehs <skydda.barnen@gmail.com> - 2016-10-24 02:10 -0700
    Re: The implementation of S, in GForth "HAA" <someone@microsoft.com> - 2016-10-25 21:39 +1000
      Re: The implementation of S, in GForth lehs <skydda.barnen@gmail.com> - 2016-10-25 05:59 -0700

csiph-web