r.s [ 2015-02-03: better name: .rs ]
Idea:
: copy-name ( "name" -- ca len ) >in @ >r parse-name r> >in ! ;
Idea found in (http://groups.google.com/group/comp.lang.forth/browse_thread/thread/7367894d3a9ac280/2829422a2a58b349):
I use: BEGIN-PRIVATE \ remember dp #1 < definitions > END-PRIVATE \ remember dp #2 < definitions > MAKE-PRIVATE \ decapitate all definitions between dp #1 & #2 Clean and simple. Decapitate means, convert those defs to real nonames, thereby freeing additional namespace. Andreas
Idea: reverse characters in a string, done in <~/ext/comp/lang/forth/prg/util/misc/units/>.
Create word sections, after Gforth, and mark them in the sources with
some conventional notation. This way the files could be searched
(e.g. with grep) for words of specific sections.
Move the tool words of <galope/to-yyyymmddhhmmss.fs> to their own files, when a similar word will need them.
ANEW --CHARSCAN-- \ Wil Baden 2002-03-17
\ *******************************************************************
\ * *
\ * Wil Baden 2003-02-17 *
\ * *
\ * String Handling with Generalization of SKIP and SCAN *
: Replace-Char ( str /str char char_2 -- )
2SWAP BOUNDS ?DO
over I C@ = IF dup I C! THEN
LOOP 2DROP ;
Write replace-xchar too.
Use comment marks, to make automatic lists of the modules:
\ galope-tag: strings \ galope-tag: time&date \ galope-tag: control_structures \ galope-tag: text_output \ galope-tag: data_stack \ galope-tag: return_stack
-
Remove
[or]. -
Check dependency on
u+doinrolls. -
Rewrite
#dowithoutevaluate. -
Finish or simplify or remove <headline.fs>.
-
Homogenize "Author: Wil Baden" and "Taken from".
Rename :create to created.
Remove ?nip?
Check if $variable is needed in Gforth 0.7.9.
Check if $@len is needed in Gforth 0.7.9.
Check if $@ is needed in Gforth 0.7.9.
Fix: UTF-8 chars are corrupted in the PDF manual. See usage example of
2arrayed. The HTML version is fine.
Improve ltype:
-
Top left coordinates.
-
Left margin.
-
UTF-8 support.
-
More/Pause control [under development as of 2017-11-16]
-
Right margin.
-
Add
?u1+!. -
Rename
number<c>(in module <xy.fs>) and move it to its own file. Possible names:number/c,keys/c>decimal,keys>#,keys>number,keys>#number. -
Remove old code from
instr.
Add a smaller version of match?, from
https://groups.google.com/d/msg/comp.lang.forth/zFRCXnlY2jY/tqkcqzbUvvwJ:
This is an even smaller one, supporting just * and .:
---8<---
: (match-or-dot)
over c@ [char] . = >r 2swap dup 0<> r> and
>r over c@ >r 2swap over c@ r> = r> or
;
: match-reg
dup 0> if
over char+ c@ [char] * <>
if
2over 1 /string 2over 1 /string recurse >r (match-or-dot)
r> and >r 2drop 2drop r> exit
then
begin
(match-or-dot)
while
2over 2over 2 /string recurse if 2drop 2drop true exit then
2>r 1 /string 2r>
repeat 2 /string recurse exit
else
2drop nip 0=
then
;
s" aa" s" a" match-reg . cr
s" aa" s" aa" match-reg . cr
s" aaa" s" aa" match-reg . cr
s" aa" s" a*" match-reg . cr
s" aa" s" .*" match-reg . cr
s" ab" s" .*" match-reg . cr
s" aab" s" c*a*b" match-reg . cr depth .
---8<---
Hans Bezemer
-
Move
@lefrom <png.fs> to its own module, with a comus name. -
Move
16@from <jpeg.fs> to its own module, with a comus name. -
Rename
@` `@+` and `!!+. -
Rename
c@` `c@+` and `c!c!+.
Alternative from https://groups.google.com/d/msg/comp.lang.forth/x4OtT2kSUqo/JqylkA9pZgoJ:
: !+ ( n addr -- addr' ) dup cell+ -rot ! ; : @+ ( addr -- n addr' ) dup @ swap cell+ ; : c!+ ( n addr -- addr' ) dup 1+ -rot c! ; : c@+ ( addr -- n addr' ) dup c@ swap 1+ ;
-
Deprecate <stream_bs.fs>, which was superseded by <heredoc.fs>.
-
Finish, update, rename words of <queue.fs>.
-
Rename
char-count,instr,instr?. -
Add
:variable. -
Rewrite <translated.fs> with Gforth’s dynamic strings instead of FFL.
-
Remove <paragraph.fs> and <print.fs>, superseded by <l-type.fs>.
-
Add to long strings support:
ls",lsliteral. -
Extract
string-prefix?from-prefix. -
Remove
basename(already in Gforth 0.7.9).
-
Remove <sconstant.fs> and <svariable.fs> after the projects have been adapted to the new module names.
-
Review <s-bracket.fs>. Compare to <strings-colon>. Write an actual
sarrayafterarrayand2array. -
Rename
strings:strings; rename/stringsend-strings. -
Homogenize stack notation of indexes: eg. change "len’n" to "len#n", "ca'2" to "ca#2".
-
Update module names to current convention, eg. "csv" to "c-s-v":
-
Rename
/csvsplit/commaor something. -
Rename
/ssvsplit/spacesor something. -
Rename <smove.fs> <s-move.fs>.
-
Deprecate <sb.fs>, superseded by <stringer.fs>.
-
Rename <typecr.fs> <type-c-r.fs>.
-
Rename <rtype.fs> <r-type.fs>.
-
Fix checks of Gforth version: the flag returned by
environment?is not checked. Eg.s" gforth" environment? drop s" 0.7.9" str< [if].
-
Improve
xconversions: The translation table could be updated with more chars; both the table and the bit array would be resized transparently; the limits would be updated. -
Improve
xconversions: The caseness bit array could be created at compile time. -
Improve names of the private words of
xconversions. -
Rename and document modules <xbounds.fs>, <xlowercase.fs>, etc.
-
Finish
xtitlecase. -
Rename
txt+. Besides, after the current convention, its module name should be <t-x-t-plus.fs>. -
Make
xconversionscreate named tables in order to define more than one table and change the current one. -
Rename <smove.fs> <s-move.fs>.
-
Rename
allocate-ss.
-
Rename
choose{ }chooseamong end-among? -
Rename
2choose{ }2choose2among end-2among? -
Rename
choose{ }choosefrom end-from? -
Rename
2choose{ }2choose2from end-2from?
-
Add
time-zonestring to ISO-8601 converters. -
Replace
aliases:’s `parse-aliaswithdo-parse-name, moved from La pistola de agua. -
Simplify (with
recurse) and document(*. -
Deprecate <stream-to-str.fs>, which was superseded by <heredoc.fs>.
-
Review all words that use
refill. Maybedo-parse-namecan be reused.
-
Copy
sconstantsfrom Solo Forth. -
Extend
iso-date>extendedto support longer date strings. -
Write
iso-date>basic. -
Check if any private word of
iso-date>extendedcan be useful.
Benchmark strings constants created by the current definition of
sconstant vs the definition of Solo Forth, which probably is faster:
: sconstant ( ca len "name" -- ) here >r s, r> count 2constant ;
Improve <uncodepaged.fs>. Find a better name, related to
translations, which is very similar.
Deprecate <s-bracket.fs>. Use 2array or strings: instead. s[ is
used only in project Consulta privada.
Simplify strings:. Rename /strings.
-
Rename
'last-xchar. -
Rename
nospace→no-space. -
Rename
unspace→no-double-space. -
Rewrite
c>strto use the pictured numeric buffer. -
Use
thinarray>?
Fix: In <galope/replaced.fs>, require was replaced with include in order to
load <ffl/str.fs>. This solved a strange problem with Gforth’s require. See
Gforth’s .included.
Improve description or behaviour of -cell-bounds:
: -cell-bounds ( a1 len1 -- a1 a2 ) 1+ -bounds cell - ;
Alternatives:
: -cell-bounds ( a1 n -- a1 a2 ) 1+ -bounds cell - ; : -cell-bounds ( a1 len1 -- a1 a2 ) cells 1+ -bounds cell - ;
Check the improvements done in Fendo’s Makefile, which was adapted from Galope’s Makefile.
Improve menu:
-
Add separators, skipped by the option selector.
-
Add inactive options, with alternative texts.