Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #39458 > unrolled thread
| Started by | josv@planet.nl |
|---|---|
| First post | 2015-05-30 07:41 -0700 |
| Last post | 2015-06-09 17:51 +1000 |
| Articles | 20 on this page of 46 — 11 participants |
Back to article view | Back to comp.lang.forth
\s josv@planet.nl - 2015-05-30 07:41 -0700
Re: \s hughaguilar96@gmail.com - 2015-05-30 09:01 -0700
Re: \s josv@planet.nl - 2015-05-30 09:59 -0700
Re: \s hughaguilar96@gmail.com - 2015-05-30 11:45 -0700
Re: \s josv@planet.nl - 2015-05-30 13:06 -0700
Re: \s Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-05-30 20:32 +0100
Re: \s hughaguilar96@gmail.com - 2015-05-31 21:48 -0700
Re: \s Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-06-01 08:27 +0100
Re: \s hughaguilar96@gmail.com - 2015-06-09 17:11 -0700
Re: \s josv@planet.nl - 2015-06-10 04:03 -0700
Re: \s Coos Haak <chforth@hccnet.nl> - 2015-05-30 22:42 +0200
Re: \s Coos Haak <chforth@hccnet.nl> - 2015-05-30 22:40 +0200
Re: \s josv@planet.nl - 2015-05-30 14:12 -0700
Re: \s "HAA" <someone@microsoft.com> - 2015-06-03 15:10 +1000
Re: \s Coos Haak <chforth@hccnet.nl> - 2015-06-03 13:58 +0200
Re: \s "HAA" <someone@microsoft.com> - 2015-06-05 21:42 +1000
Re: \s albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-05-31 14:46 +0000
Re: \s josv@planet.nl - 2015-05-31 09:38 -0700
Re: \s albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-06-01 10:58 +0000
Re: \s Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-05-31 21:04 +0100
Re: \s Bernd Paysan <bernd.paysan@gmx.de> - 2015-05-31 22:14 +0200
Re: \s "HAA" <someone@microsoft.com> - 2015-06-01 13:44 +1000
Re: \s Coos Haak <chforth@hccnet.nl> - 2015-06-01 12:17 +0200
Re: \s "HAA" <someone@microsoft.com> - 2015-06-03 12:55 +1000
Re: \s Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-03 16:39 +0200
Re: \s "HAA" <someone@microsoft.com> - 2015-06-05 21:36 +1000
Re: \s Coos Haak <chforth@hccnet.nl> - 2015-06-05 13:54 +0200
Re: \s "HAA" <someone@microsoft.com> - 2015-06-13 16:20 +1000
Re: \s coos <chforth@hccnet.nl> - 2015-06-13 21:34 +0200
Re: \s "Alex McDonald" <blog@rivadpm.com> - 2015-06-16 20:51 +0100
Re: \s Mark Wills <markwills1970@gmail.com> - 2015-06-17 01:06 -0700
Re: \s coos <chforth@hccnet.nl> - 2015-06-17 16:15 +0200
Re: \s coos <chforth@hccnet.nl> - 2015-06-17 16:28 +0200
Re: \s Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-08 01:10 +0200
Re: \s anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-08 07:56 +0000
Re: \s Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-08 17:12 +0200
Re: \s "HAA" <someone@microsoft.com> - 2015-06-09 17:53 +1000
Re: \s Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-09 23:40 +0200
Re: \s hughaguilar96@gmail.com - 2015-06-13 22:46 -0700
Re: \s coos <chforth@hccnet.nl> - 2015-06-14 17:01 +0200
Re: \s hughaguilar96@gmail.com - 2015-06-14 10:32 -0700
Re: \s coos <chforth@hccnet.nl> - 2015-06-14 17:00 +0200
Re: \s Mark Wills <markwills1970@gmail.com> - 2015-06-05 05:13 -0700
Re: \s Coos Haak <chforth@hccnet.nl> - 2015-06-05 14:37 +0200
Re: \s Mark Wills <markwills1970@gmail.com> - 2015-06-05 10:28 -0700
Re: \s "HAA" <someone@microsoft.com> - 2015-06-09 17:51 +1000
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Date | 2015-05-31 22:14 +0200 |
| Message-ID | <mkfq1i$185$1@dont-email.me> |
| In reply to | #39483 |
Gerry Jackson wrote: > : \s source-id file-size throw ( -- ud ) > source-id reposition-file throw ( -- ) > ; > > However the Forth 200X committee decided that was not a valid thing to > do and banned it in the Forth 2012 document. It's not something you can rely on. > But IIRC it used to work in GForth and perhaps still does. My point of view is that a quality implementation should honor this, following the principle of least surprise. If you want to optimize, e.g. slurp in the entire file (or bigger chunks of it) and then present it line by line to the interpreter, you can as well implement FILE-POSITION and REPOSITION-FILE in a way which works on buffers. After all, we do use C's io buffers in Gforth, which work like that. You should add a POSTPONE \ to make sure that the rest of the \S line is also commented out. BTW: no need to implement it, Gforth already has \\\ which has the same effect. It's implemented portably, i.e. it first does the REPOSITION-FILE thing, and then a REFILL loop, and finally the POSTPONE \. -- Bernd Paysan "If you want it done right, you have to do it yourself" net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ* http://bernd-paysan.de/
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2015-06-01 13:44 +1000 |
| Message-ID | <mkgkdf$du5$1@speranza.aioe.org> |
| In reply to | #39485 |
Bernd Paysan wrote: > ... > BTW: no need to implement it, Gforth already has \\\ which has the same > effect. It's implemented portably, i.e. it first does the REPOSITION-FILE > thing, and then a REFILL loop, and finally the POSTPONE \. Block file support? Skipping the remainder of a block was originally done with EXIT but that's not possible on many systems today.
[toc] | [prev] | [next] | [standalone]
| From | Coos Haak <chforth@hccnet.nl> |
|---|---|
| Date | 2015-06-01 12:17 +0200 |
| Message-ID | <14ebtzhv4ssat$.5yjqqz1glfud$.dlg@40tude.net> |
| In reply to | #39493 |
Op Mon, 1 Jun 2015 13:44:29 +1000 schreef HAA: > Bernd Paysan wrote: >> ... >> BTW: no need to implement it, Gforth already has \\\ which has the same >> effect. It's implemented portably, i.e. it first does the REPOSITION-FILE >> thing, and then a REFILL loop, and finally the POSTPONE \. > > Block file support? Skipping the remainder of a block was originally done > with EXIT but that's not possible on many systems today. Yes, but blocks consist of tekst without end-of-line markers, text files do. Notable exception: ciforth. In blocks my \s does work. -- Coos CHForth, 16 bit DOS applications http://home.hccnet.nl/j.j.haak/forth.html
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2015-06-03 12:55 +1000 |
| Message-ID | <mklqr2$is4$1@speranza.aioe.org> |
| In reply to | #39497 |
Coos Haak wrote: > Op Mon, 1 Jun 2015 13:44:29 +1000 schreef HAA: > > > Bernd Paysan wrote: > >> ... > >> BTW: no need to implement it, Gforth already has \\\ which has the same > >> effect. It's implemented portably, i.e. it first does the REPOSITION-FILE > >> thing, and then a REFILL loop, and finally the POSTPONE \. > > > > Block file support? Skipping the remainder of a block was originally done > > with EXIT but that's not possible on many systems today. > > Yes, but blocks consist of tekst without end-of-line markers, text files > do. Notable exception: ciforth. > In blocks my \s does work. Perhaps Bernd will adopt your implementation.
[toc] | [prev] | [next] | [standalone]
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Date | 2015-06-03 16:39 +0200 |
| Message-ID | <mkn3g9$94f$1@dont-email.me> |
| In reply to | #39531 |
HAA wrote: > Coos Haak wrote: >> Op Mon, 1 Jun 2015 13:44:29 +1000 schreef HAA: >> >> > Bernd Paysan wrote: >> >> ... >> >> BTW: no need to implement it, Gforth already has \\\ which has the >> >> same >> >> effect. It's implemented portably, i.e. it first does the >> >> REPOSITION-FILE thing, and then a REFILL loop, and finally the >> >> POSTPONE \. >> > >> > Block file support? Skipping the remainder of a block was originally >> > done with EXIT but that's not possible on many systems today. >> >> Yes, but blocks consist of tekst without end-of-line markers, text files >> do. Notable exception: ciforth. >> In blocks my \s does work. > > Perhaps Bernd will adopt your implementation. Block remainder skipping is usually called \\, but Gforth doesn't have it, because very few people use blocks ;-). Implementation is trivial, though. -- Bernd Paysan "If you want it done right, you have to do it yourself" net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ* http://bernd-paysan.de/
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2015-06-05 21:36 +1000 |
| Message-ID | <mks1qc$rsr$1@speranza.aioe.org> |
| In reply to | #39544 |
Bernd Paysan wrote:
> HAA wrote:
>
> > Coos Haak wrote:
> >> Op Mon, 1 Jun 2015 13:44:29 +1000 schreef HAA:
> >>
> >> > Bernd Paysan wrote:
> >> >> ...
> >> >> BTW: no need to implement it, Gforth already has \\\ which has the
> >> >> same
> >> >> effect. It's implemented portably, i.e. it first does the
> >> >> REPOSITION-FILE thing, and then a REFILL loop, and finally the
> >> >> POSTPONE \.
> >> >
> >> > Block file support? Skipping the remainder of a block was originally
> >> > done with EXIT but that's not possible on many systems today.
> >>
> >> Yes, but blocks consist of tekst without end-of-line markers, text files
> >> do. Notable exception: ciforth.
> >> In blocks my \s does work.
> >
> > Perhaps Bernd will adopt your implementation.
>
> Block remainder skipping is usually called \\, but Gforth doesn't have it,
> because very few people use blocks ;-).
Blocks are still in 200x ?
> Implementation is trivial, though.
Agreed
: \\
is-current-source-a-text-file? if
begin refill 0= until
else ( keyboard, block file or Evaluate)
source >in ! drop
then ; immediate
It's Immediate only because \ and ( are.
[toc] | [prev] | [next] | [standalone]
| From | Coos Haak <chforth@hccnet.nl> |
|---|---|
| Date | 2015-06-05 13:54 +0200 |
| Message-ID | <52ki0a5jab4l.1u28v3lylo6by$.dlg@40tude.net> |
| In reply to | #39572 |
Op Fri, 5 Jun 2015 21:36:54 +1000 schreef HAA: > Bernd Paysan wrote: >> HAA wrote: >> >>> Coos Haak wrote: >>>> Op Mon, 1 Jun 2015 13:44:29 +1000 schreef HAA: >>>> >>>> > Bernd Paysan wrote: >>>> >> ... >>>> >> BTW: no need to implement it, Gforth already has \\\ which has the >>>> >> same >>>> >> effect. It's implemented portably, i.e. it first does the >>>> >> REPOSITION-FILE thing, and then a REFILL loop, and finally the >>>> >> POSTPONE \. >>>> > >>>> > Block file support? Skipping the remainder of a block was originally >>>> > done with EXIT but that's not possible on many systems today. >>>> >>>> Yes, but blocks consist of tekst without end-of-line markers, text files >>>> do. Notable exception: ciforth. >>>> In blocks my \s does work. >>> >>> Perhaps Bernd will adopt your implementation. >> >> Block remainder skipping is usually called \\, but Gforth doesn't have it, >> because very few people use blocks ;-). > > Blocks are still in 200x ? It's even mandate to have the BLOCK wordset if you have the FILE wordset. But I could live without. > >> Implementation is trivial, though. > > Agreed > >: \\ > is-current-source-a-text-file? if > begin refill 0= until > else ( keyboard, block file or Evaluate) > source >in ! drop > then ; immediate Too much code. > > It's Immediate only because \ and ( are. It's not a comment: what if you by accident place it in the body of a definition. You're still in compile mode. At least use something like ?EXEC. -- Coos CHForth, 16 bit DOS applications http://home.hccnet.nl/j.j.haak/forth.html
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2015-06-13 16:20 +1000 |
| Message-ID | <mlgid7$g3s$1@speranza.aioe.org> |
| In reply to | #39575 |
Coos Haak wrote: > Op Fri, 5 Jun 2015 21:36:54 +1000 schreef HAA: > ... > >: \\ > > is-current-source-a-text-file? if > > begin refill 0= until > > else ( keyboard, block file or Evaluate) > > source >in ! drop > > then ; immediate > > Too much code. For miracles you need to look elsewhere > It's Immediate only because \ and ( are. > It's not a comment: You can argue over it with Forth Inc : \\ ( - ) During an INCLUDE operation, treat anything following this word as a comment; i.e., anything that follows \\ in a source file will not be compiled. > what if you by accident place it in the body of a > definition. You're still in compile mode. Same can happen with an unterminated ( or colon definition. I'm not concerned > At least use something like ?EXEC. Ditto
[toc] | [prev] | [next] | [standalone]
| From | coos <chforth@hccnet.nl> |
|---|---|
| Date | 2015-06-13 21:34 +0200 |
| Message-ID | <ale1nc27inw4$.1l6tlishaal4z.dlg@40tude.net> |
| In reply to | #39714 |
Op Sat, 13 Jun 2015 16:20:30 +1000 schreef HAA: > Coos Haak wrote: >> Op Fri, 5 Jun 2015 21:36:54 +1000 schreef HAA: >> ... >>>: \\ >>> is-current-source-a-text-file? if >>> begin refill 0= until >>> else ( keyboard, block file or Evaluate) >>> source >in ! drop >>> then ; immediate >> >> Too much code. > > For miracles you need to look elsewhere > >> It's Immediate only because \ and ( are. >> It's not a comment: > > You can argue over it with Forth Inc : > > \\ ( - ) > During an INCLUDE operation, treat anything following this > word as a comment; i.e., anything that follows \\ in a source > file will not be compiled. > >> what if you by accident place it in the body of a >> definition. You're still in compile mode. > > Same can happen with an unterminated ( or colon definition. > I'm not concerned In a file, ( may have no terminating ), look it up. groet Coos
[toc] | [prev] | [next] | [standalone]
| From | "Alex McDonald" <blog@rivadpm.com> |
|---|---|
| Date | 2015-06-16 20:51 +0100 |
| Message-ID | <mlpumc$d16$1@dont-email.me> |
| In reply to | #39724 |
on 13/06/2015 20:34:13, coos wrote: > Op Sat, 13 Jun 2015 16:20:30 +1000 schreef HAA: > >> Coos Haak wrote: >>> Op Fri, 5 Jun 2015 21:36:54 +1000 schreef HAA: >>> ... >>>>: \\ >>>> is-current-source-a-text-file? if >>>> begin refill 0= until >>>> else ( keyboard, block file or Evaluate) >>>> source >in ! drop >>>> then ; immediate >>> >>> Too much code. >> >> For miracles you need to look elsewhere >> >>> It's Immediate only because \ and ( are. >>> It's not a comment: >> >> You can argue over it with Forth Inc : >> >> \\ ( - ) >> During an INCLUDE operation, treat anything following this >> word as a comment; i.e., anything that follows \\ in a source >> file will not be compiled. >> >>> what if you by accident place it in the body of a >>> definition. You're still in compile mode. >> >> Same can happen with an unterminated ( or colon definition. >> I'm not concerned > > In a file, ( may have no terminating ), look it up. > > groet Coos > It's not clear to me what ( should do from the console if there's no matching ). I assume the comment ends on the same line if it is missing.
[toc] | [prev] | [next] | [standalone]
| From | Mark Wills <markwills1970@gmail.com> |
|---|---|
| Date | 2015-06-17 01:06 -0700 |
| Message-ID | <90e5a7d4-cf14-4184-8845-dfaa3ee791cb@googlegroups.com> |
| In reply to | #39789 |
On Tuesday, 16 June 2015 20:51:55 UTC+1, Alex McDonald wrote:
> on 13/06/2015 20:34:13, coos wrote:
> > Op Sat, 13 Jun 2015 16:20:30 +1000 schreef HAA:
> >
> >> Coos Haak wrote:
> >>> Op Fri, 5 Jun 2015 21:36:54 +1000 schreef HAA:
> >>> ...
> >>>>: \\
> >>>> is-current-source-a-text-file? if
> >>>> begin refill 0= until
> >>>> else ( keyboard, block file or Evaluate)
> >>>> source >in ! drop
> >>>> then ; immediate
> >>>
> >>> Too much code.
> >>
> >> For miracles you need to look elsewhere
> >>
> >>> It's Immediate only because \ and ( are.
> >>> It's not a comment:
> >>
> >> You can argue over it with Forth Inc :
> >>
> >> \\ ( - )
> >> During an INCLUDE operation, treat anything following this
> >> word as a comment; i.e., anything that follows \\ in a source
> >> file will not be compiled.
> >>
> >>> what if you by accident place it in the body of a
> >>> definition. You're still in compile mode.
> >>
> >> Same can happen with an unterminated ( or colon definition.
> >> I'm not concerned
> >
> > In a file, ( may have no terminating ), look it up.
> >
> > groet Coos
> >
>
> It's not clear to me what ( should do from the console if there's no
> matching ). I assume the comment ends on the same line if it is missing.
That's how my system works, yes. More as a side effect of the word WORD
than by design. In a block, a missing ) will cause the rest of the
block to be 'sucked up' by ( but you're not using blocks so I guess
you're okay.
My definition is simply:
; Comments: ( \ & .(
; Allows comments e.g. : 1TO3 ( comment) 1 2 3 ;
; Reads through the TIB until ) is found or end of line
remh data expcth,immed+1
text '( '
rem data docol
data lit,')',word,drop2
data exit
Which translates to:
: (
ascii ) word 2drop ; immediate
( now I can use comments! and stack sigs!)
Mark
[toc] | [prev] | [next] | [standalone]
| From | coos <chforth@hccnet.nl> |
|---|---|
| Date | 2015-06-17 16:15 +0200 |
| Message-ID | <bp2qptio5l.1l2mndbqmcaz6.dlg@40tude.net> |
| In reply to | #39798 |
Op Wed, 17 Jun 2015 01:06:16 -0700 (PDT) schreef Mark Wills:
> On Tuesday, 16 June 2015 20:51:55 UTC+1, Alex McDonald wrote:
>> on 13/06/2015 20:34:13, coos wrote:
>>> Op Sat, 13 Jun 2015 16:20:30 +1000 schreef HAA:
>>>
>>>> Coos Haak wrote:
>>>>> Op Fri, 5 Jun 2015 21:36:54 +1000 schreef HAA:
>>>>> ...
>>>>>>: \\
>>>>>> is-current-source-a-text-file? if
>>>>>> begin refill 0= until
>>>>>> else ( keyboard, block file or Evaluate)
>>>>>> source >in ! drop
>>>>>> then ; immediate
>>>>>
>>>>> Too much code.
>>>>
>>>> For miracles you need to look elsewhere
>>>>
>>>>> It's Immediate only because \ and ( are.
>>>>> It's not a comment:
>>>>
>>>> You can argue over it with Forth Inc :
>>>>
>>>> \\ ( - )
>>>> During an INCLUDE operation, treat anything following this
>>>> word as a comment; i.e., anything that follows \\ in a source
>>>> file will not be compiled.
>>>>
>>>>> what if you by accident place it in the body of a
>>>>> definition. You're still in compile mode.
>>>>
>>>> Same can happen with an unterminated ( or colon definition.
>>>> I'm not concerned
>>>
>>> In a file, ( may have no terminating ), look it up.
>>>
>>> groet Coos
>>>
>>
>> It's not clear to me what ( should do from the console if there's no
>> matching ). I assume the comment ends on the same line if it is missing.
>
> That's how my system works, yes. More as a side effect of the word WORD
> than by design. In a block, a missing ) will cause the rest of the
> block to be 'sucked up' by ( but you're not using blocks so I guess
> you're okay.
>
> My definition is simply:
>
> ; Comments: ( \ & .(
> ; Allows comments e.g. : 1TO3 ( comment) 1 2 3 ;
> ; Reads through the TIB until ) is found or end of line
> remh data expcth,immed+1
> text '( '
> rem data docol
> data lit,')',word,drop2
> data exit
>
> Which translates to:
>
>: (
> ascii ) word 2drop ; immediate
drop
Perhaps you were thinking of
: ( [char] ) parse 2drop ; immediate
> ( now I can use comments! and stack sigs!)
>
> Mark
groet Coos
[toc] | [prev] | [next] | [standalone]
| From | coos <chforth@hccnet.nl> |
|---|---|
| Date | 2015-06-17 16:28 +0200 |
| Message-ID | <1b4jshhdn8u66.13cij44fdedgo$.dlg@40tude.net> |
| In reply to | #39803 |
Op Wed, 17 Jun 2015 16:15:33 +0200 schreef coos: > Op Wed, 17 Jun 2015 01:06:16 -0700 (PDT) schreef Mark Wills: > <snip> >>: ( >> ascii ) word 2drop ; immediate > drop > Perhaps you were thinking of >: ( [char] ) parse 2drop ; immediate > >> ( now I can use comments! and stack sigs!) >> >> Mark > Moreover, the version with WORD has a bug: ( )fail will parse past fail because WORD can't handle NULL strings. The version with PARSE stops right after ) as is intended. groet Coos
[toc] | [prev] | [next] | [standalone]
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Date | 2015-06-08 01:10 +0200 |
| Message-ID | <ml2itv$vnl$1@dont-email.me> |
| In reply to | #39572 |
HAA wrote: >> Block remainder skipping is usually called \\, but Gforth doesn't have >> it, because very few people use blocks ;-). > > Blocks are still in 200x ? Yes. It always was an optional wordset, but we managed as last-minute change to drop the "if you have the file wordset, you also must have the block wordset" from ANS Forth. So you now can have a standard Forth without block wordset, but the standard file wordset. >> Implementation is trivial, though. > > Agreed > > : \\ > is-current-source-a-text-file? if > begin refill 0= until > else ( keyboard, block file or Evaluate) > source >in ! drop > then ; immediate I've a block->file converter, which emits a linefeed character at the end of each block (in an empty line). I'd then implement \\ to skip until that linefeed character, so that you simply can convert a block file into a stream file, and it still works including all \\ comments. If you don't have a linefeed in your file, it will then end the current file. -- Bernd Paysan "If you want it done right, you have to do it yourself" net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ* http://bernd-paysan.de/
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2015-06-08 07:56 +0000 |
| Message-ID | <2015Jun8.095614@mips.complang.tuwien.ac.at> |
| In reply to | #39621 |
Bernd Paysan <bernd.paysan@gmx.de> writes:
>I've a block->file converter, which emits a linefeed character at the end of
>each block (in an empty line). I'd then implement \\ to skip until that
>linefeed character, so that you simply can convert a block file into a
>stream file, and it still works including all \\ comments.
At least in Unix and Windows, every newline contains a line feed, so
looking for a line feed would just go to the next line. And looking
for two consecutive line feeds would find any empty line.
Do you mean a form feed? That would appear a logical choice for
sectioning a file into blocks or pages.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2015: http://www.mpeforth.com/euroforth2015/euroforth2015.htm
[toc] | [prev] | [next] | [standalone]
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Date | 2015-06-08 17:12 +0200 |
| Message-ID | <ml4baj$6sm$1@dont-email.me> |
| In reply to | #39632 |
Anton Ertl wrote: > Bernd Paysan <bernd.paysan@gmx.de> writes: >>I've a block->file converter, which emits a linefeed character at the end >>of >>each block (in an empty line). I'd then implement \\ to skip until that >>linefeed character, so that you simply can convert a block file into a >>stream file, and it still works including all \\ comments. > > At least in Unix and Windows, every newline contains a line feed, so > looking for a line feed would just go to the next line. And looking > for two consecutive line feeds would find any empty line. > > Do you mean a form feed? That would appear a logical choice for > sectioning a file into blocks or pages. Yes, I meant form feed. -- Bernd Paysan "If you want it done right, you have to do it yourself" net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ* http://bernd-paysan.de/
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2015-06-09 17:53 +1000 |
| Message-ID | <ml6626$ucg$1@speranza.aioe.org> |
| In reply to | #39621 |
Bernd Paysan wrote: > HAA wrote: > >> Block remainder skipping is usually called \\, but Gforth doesn't have > >> it, because very few people use blocks ;-). > > > > Blocks are still in 200x ? > > Yes. It always was an optional wordset, but we managed as last-minute > change to drop the "if you have the file wordset, you also must have the > block wordset" from ANS Forth. > > So you now can have a standard Forth without block wordset, but the standard > file wordset. So if \\ were ever to be standardized it could not ignore blocks :) > ... > I've a block->file converter, which emits a linefeed character at the end of > each block (in an empty line). I'd then implement \\ to skip until that > linefeed character, so that you simply can convert a block file into a > stream file, and it still works including all \\ comments. > > If you don't have a linefeed in your file, it will then end the current > file. What of the LOAD THRU --> etc commands originally present in the block file? These will require manual conversion before the resulting text file will work. Dealing with \\ would be least of my concerns.
[toc] | [prev] | [next] | [standalone]
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Date | 2015-06-09 23:40 +0200 |
| Message-ID | <ml7md6$7pp$2@dont-email.me> |
| In reply to | #39649 |
HAA wrote: > What of the LOAD THRU --> etc commands originally present in the block > file? These will require manual conversion before the resulting text file > will work. Dealing with \\ would be least of my concerns. --> does just a refill, and therefor works in the converted file (reads the next line). LOAD and THRU have to be edited away, but that's usually just a load screen, and therefore easy to do (or very hard, if you have a load screen which contains a lot of LOADs and THRUs ;-). -- Bernd Paysan "If you want it done right, you have to do it yourself" net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ* http://bernd-paysan.de/
[toc] | [prev] | [next] | [standalone]
| From | hughaguilar96@gmail.com |
|---|---|
| Date | 2015-06-13 22:46 -0700 |
| Message-ID | <9cd20c88-98be-46f2-a7ad-ac74bbf6ca7c@googlegroups.com> |
| In reply to | #39572 |
On Friday, June 5, 2015 at 4:40:01 AM UTC-7, HAA wrote: > Bernd Paysan wrote: > > Implementation is trivial, though. > > Agreed > > : \\ > is-current-source-a-text-file? if > begin refill 0= until > else ( keyboard, block file or Evaluate) > source >in ! drop > then ; immediate > > It's Immediate only because \ and ( are. So how does IS-CURRENT-SOURCE-A-TEXT-FILE work in ANS-Forth? That doesn't look trivial to me.
[toc] | [prev] | [next] | [standalone]
| From | coos <chforth@hccnet.nl> |
|---|---|
| Date | 2015-06-14 17:01 +0200 |
| Message-ID | <rt6xq4qk7znc.v1pd2gmgws8y$.dlg@40tude.net> |
| In reply to | #39731 |
Op Sat, 13 Jun 2015 22:46:26 -0700 (PDT) schreef hughaguilar96@gmail.com: > On Friday, June 5, 2015 at 4:40:01 AM UTC-7, HAA wrote: >> Bernd Paysan wrote: >>> Implementation is trivial, though. >> >> Agreed >> >>: \\ >> is-current-source-a-text-file? if >> begin refill 0= until >> else ( keyboard, block file or Evaluate) >> source >in ! drop >> then ; immediate >> >> It's Immediate only because \ and ( are. > > So how does IS-CURRENT-SOURCE-A-TEXT-FILE work in ANS-Forth? That doesn't look trivial to me. Correction: SOURCE-ID 0> BLK 0= AND groet Coos
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | comp.lang.forth
csiph-web