Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #9523 > unrolled thread
| Started by | "Ed" <nospam@invalid.com> |
|---|---|
| First post | 2012-02-13 21:24 +1100 |
| Last post | 2012-03-01 18:52 +0000 |
| Articles | 20 on this page of 141 — 26 participants |
Back to article view | Back to comp.lang.forth
Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-13 21:24 +1100
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-02-13 13:05 -0800
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-16 10:19 +1100
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-02-15 08:48 +0100
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-02-23 22:46 -0800
Re: Adding thousands separators "A. K." <akk@nospam.org> - 2012-02-24 08:07 +0100
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-02-24 15:00 +0100
Re: Adding thousands separators "Elizabeth D. Rather" <erather@forth.com> - 2012-02-24 08:29 -1000
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-02-25 00:11 +0100
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-02-27 23:28 -0800
Re: Adding thousands separators Alex McDonald <blog@rivadpm.com> - 2012-02-28 01:37 -0800
Re: Adding thousands separators Ron Aaron <rambamist@gmail.com> - 2012-02-28 15:06 +0200
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-02-29 09:29 +0100
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-29 03:00 -0600
Re: Adding thousands separators The Beez <the.beez.speaks@gmail.com> - 2012-02-29 03:44 -0800
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-29 11:19 -0600
Re: Adding thousands separators hughaguilar96@yahoo.com - 2012-02-29 22:48 -0800
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-01 08:38 +0100
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-01 00:57 -0800
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-01 18:23 +0100
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-01 17:22 -0800
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-01 18:00 -0800
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-01 22:14 -0800
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-02 06:58 -0800
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-02 11:07 -0800
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-02 13:13 -0600
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-02 11:25 -0800
Re: Adding thousands separators Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-03 11:00 +0000
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-03 03:17 -0800
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-03 12:30 +0000
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-03 11:39 -0800
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-06 16:31 -0800
Re: Adding thousands separators mhx@iae.nl (Marcel Hendrix) - 2012-03-03 15:52 +0200
Re: Adding thousands separators Coos Haak <chforth@hccnet.nl> - 2012-03-03 16:23 +0100
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-03 10:19 -0800
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-03 12:35 -0800
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-03 11:02 -0600
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-03 17:25 +0000
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-03 10:14 -0800
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-03 14:14 -0600
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-03 14:52 -0800
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-04 03:39 -0600
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-04 15:02 +0000
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-03 14:11 -0600
Re: Adding thousands separators Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-03 23:49 +0100
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-03 15:50 -0800
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-04 15:38 +0000
Re: Adding thousands separators Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-04 18:08 +0100
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-04 11:20 -0600
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-04 17:45 +0000
Re: Adding thousands separators Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-04 23:50 +0100
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-05 14:39 +0000
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-03-06 13:01 -0800
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-12 16:05 +0000
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-03 15:45 -0800
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-03 17:56 -0800
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-05 15:41 -0800
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-06 11:27 -0800
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-03 11:01 -0800
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-02 05:53 -0800
Re: Adding thousands separators Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-03 01:49 +0100
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-29 17:20 +1100
Re: Adding thousands separators "A. K." <akk@nospam.org> - 2012-02-29 07:51 +0100
Re: Adding thousands separators hughaguilar96@yahoo.com - 2012-02-29 21:26 -0800
Re: Adding thousands separators "WJ" <w_a_x_man@yahoo.com> - 2012-03-03 03:45 +0000
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-03-04 20:49 +1100
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-04 15:16 +0100
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-03-06 15:06 +1100
Re: Adding thousands separators Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-06 08:32 +0100
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-05 15:06 -0800
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-03-06 15:03 +1100
Re: Adding thousands separators hwfwguy@gmail.com - 2012-03-06 20:29 -0800
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-06 23:18 -0800
Re: Adding thousands separators John Passaniti <john.passaniti@gmail.com> - 2012-03-07 06:07 -0800
Re: Adding thousands separators hwfwguy@gmail.com - 2012-03-07 06:36 -0800
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-07 16:19 -0800
Re: Adding thousands separators Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-08 10:51 +0000
Re: Adding thousands separators Doug Hoffman <glidedog@gmail.com> - 2012-02-15 20:18 -0500
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-17 12:29 +1100
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-17 09:42 -0800
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-20 15:24 +0000
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-20 20:41 -0800
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-21 16:46 +0000
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-21 12:23 -0600
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-21 11:32 -0800
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-22 12:46 +1100
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-22 10:08 +0000
Re: Adding thousands separators "Elizabeth D. Rather" <erather@forth.com> - 2012-02-22 08:51 -1000
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-22 14:28 -0800
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-23 13:13 +0000
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-24 14:32 +1100
Re: Adding thousands separators "Elizabeth D. Rather" <erather@forth.com> - 2012-02-23 19:53 -1000
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-03-03 12:47 +1100
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-03-02 22:26 -0800
Re: Adding thousands separators Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2012-03-03 14:32 +0000
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-03-04 21:31 +1100
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-03-04 10:07 -0800
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-03-06 15:31 +1100
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-03-05 22:26 -0800
Re: Adding thousands separators Josh Grams <josh@qualdan.com> - 2012-03-06 12:32 +0000
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-24 05:04 -0800
Re: Adding thousands separators "Elizabeth D. Rather" <erather@forth.com> - 2012-02-24 08:30 -1000
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-22 04:28 -0600
Re: Adding thousands separators stephenXXX@mpeforth.com (Stephen Pelc) - 2012-02-22 14:59 +0000
Re: Adding thousands separators stephenXXX@mpeforth.com (Stephen Pelc) - 2012-02-22 18:05 +0000
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-22 07:49 -0800
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-02-22 12:46 -0800
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-22 18:24 -0800
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-24 13:23 +1100
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-21 11:29 -0800
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-22 09:56 +0000
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-22 07:37 -0800
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-22 10:30 -0600
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-22 16:24 +0000
Re: Adding thousands separators Brad <hwfwguy@gmail.com> - 2012-02-23 07:44 -0800
Re: Adding thousands separators Bernd Paysan <bernd.paysan@gmx.de> - 2012-02-23 17:54 +0100
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-23 16:51 +0000
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-23 11:49 -0600
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-02-23 13:26 -0800
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-23 15:58 -0600
Re: Adding thousands separators Bernd Paysan <bernd.paysan@gmx.de> - 2012-02-26 02:25 +0100
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-26 03:24 -0600
Re: Adding thousands separators anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-26 13:40 +0000
Re: Adding thousands separators Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-02-26 11:06 -0600
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-23 15:02 -0800
Re: Adding thousands separators Doug Hoffman <glidedog@gmail.com> - 2012-02-16 13:21 -0500
Re: Adding thousands separators Paul Rubin <no.email@nospam.invalid> - 2012-02-16 20:44 -0800
Re: Adding thousands separators Coos Haak <chforth@hccnet.nl> - 2012-02-17 21:32 +0100
Re: Adding thousands separators "A. K." <akk@nospam.org> - 2012-02-17 22:41 +0100
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-17 18:52 -0800
Re: Adding thousands separators "A. K." <akk@nospam.org> - 2012-02-18 10:39 +0100
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-02-18 21:22 +1100
Re: Adding thousands separators "A. K." <akk@nospam.org> - 2012-02-18 13:12 +0100
Re: Adding thousands separators "Peter Knaggs" <pjk@bcs.org.uk> - 2012-02-18 16:30 +0000
Re: Adding thousands separators Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2012-02-18 17:08 +0000
Re: Adding thousands separators BruceMcF <agila61@netscape.net> - 2012-02-18 14:46 -0800
Re: Adding thousands separators "Ed" <nospam@invalid.com> - 2012-03-04 20:47 +1100
Re: Adding thousands separators Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-02-28 17:03 -0800
Re: Adding thousands separators "WJ" <w_a_x_man@yahoo.com> - 2012-03-01 18:13 +0000
Re: Adding thousands separators Alex McDonald <blog@rivadpm.com> - 2012-03-01 12:46 -0800
Re: Adding thousands separators "WJ" <w_a_x_man@yahoo.com> - 2012-03-01 18:52 +0000
Page 4 of 8 — ← Prev page 1 2 3 [4] 5 6 7 8 Next page →
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Date | 2012-03-03 01:49 +0100 |
| Message-ID | <jirpqc$8ma$1@online.de> |
| In reply to | #9778 |
John Passaniti wrote: > For most everyone else, polymorphism is perhaps the key feature of OOP > that people value. It's the feature that makes inheritance useful > beyond just simple aggregation of data. It's the feature that lets > you treat subtypes consistently and without having to resort to > control structures that dispatch based on type. It's pretty > fundamental. I can easily imagine object oriented programming without > (strict) encapsulation and without inheritance. I can't imagine > object-oriented programming without polymorphism in some form. If you > can, I'd really enjoy hearing how you define object-oriented because > it's completely outside any definition I'm aware of. Well, it seems to be quite difficult to get that message through. Stephen Pelc opened the discussion on last EuroForth, and it soon turned out that quite a number of people in the Forth community think, OOP is structures with some words attached in a private scope, and this weird late binding/polymorphism/vtable concept is not necessary, and too complicated, anyways (nonwithstanding that mini-oof, with its just 12 lines, implements that). Strict encapsulation is something that is counter the philosophy of Forth not to bury your tools, and to enforce sanity of the code through the compiler. The code may be insane, but the compiler is certainly not clever enoung to know if that's the case. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/
[toc] | [prev] | [next] | [standalone]
| From | "Ed" <nospam@invalid.com> |
|---|---|
| Date | 2012-02-29 17:20 +1100 |
| Message-ID | <jikfuk$9qs$1@news-01.bur.connect.com.au> |
| In reply to | #9696 |
Hugh Aguilar wrote:
>
> The guy's code was not clean. He is dismantling one string to make
> another string. What??? I just wrote a typical picture-number function
> that takes a double and generates a string using # and HOLD and all
> that.
Nothing wrong with processing strings. The application was intended
to convert string output from my floating-point package. Were integers
my only consideration the following would have sufficed:
\ Comma formatted numeric output
\ Adapted from code by C.Curley FD15/5
\ like #S but inserts commas after each 3 digits
: #,S ( ud -- 0. )
0 begin >r # 2dup or while
r> 1+ dup 3 = if [char] , hold drop 0 then
repeat r> drop ;
> Also, he wrote a really long
> function that badly needed factoring. This is very novice-level Forth.
> If you guys were the experts that you claim to be, you would be
> helping him to improve his Forth. Instead the Beez congratulates him
> on his "clean" code and says that it qualifies for inclusion in the
> 4TH compiler, and the whole crowd immediately launches into a
> discussion of ones-complement arithmetic. What??? The poor guy is not
> going to learn anything about Forth from you guys --- I predict that
> he is going to drop Forth pretty soon, just like everybody else who
> tries to learn it.
A novice after 25 years! If being a novice means there is still
something I can learn, well that sounds like a good thing. Better
to be a novice than an "expert" who's constantly in fear of being
upstaged. Personally I can't think of anything more exciting than
to discover something which I had believed to be true, turns out
false. The trick is to never hitch one's wagon to anything so
permanently that it destroys one when the time comes to let it go.
For me, Forth is just such a thing.
[toc] | [prev] | [next] | [standalone]
| From | "A. K." <akk@nospam.org> |
|---|---|
| Date | 2012-02-29 07:51 +0100 |
| Message-ID | <4f4dcaf3$0$7617$9b4e6d93@newsspool1.arcor-online.net> |
| In reply to | #9743 |
On 29.02.2012 07:20, Ed wrote: > The trick is to never hitch one's wagon to anything so > permanently that it destroys one when the time comes to let it go. > For me, Forth is just such a thing. You'll be destroyed by the time anyhow, even when the time comes when SWAP isn't SWAP any more. [Book of MormoF]
[toc] | [prev] | [next] | [standalone]
| From | hughaguilar96@yahoo.com |
|---|---|
| Date | 2012-02-29 21:26 -0800 |
| Message-ID | <19341185.748.1330579571302.JavaMail.geo-discussion-forums@ynjd19> |
| In reply to | #9743 |
On Tuesday, February 28, 2012 11:20:50 PM UTC-7, Ed wrote: > Hugh Aguilar wrote: > > > > The guy's code was not clean. He is dismantling one string to make > > another string. What??? I just wrote a typical picture-number function > > that takes a double and generates a string using # and HOLD and all > > that. > > Nothing wrong with processing strings. Processing strings representing numbers is a messy way to process numbers. For one thing, you get into a lot of error-checking to make sure that the string is in the format that you are expecting --- that it is actually a string representing a number and that it was generated by whatever float>string function that you are assuming that it was generated by. It is very bad design to write a function that depends upon getting input which is the output of specific other functions. That is a DEPENDENCY (a bad thing). What happens if that other function gets modified, and now this function that depends upon it stops working because it is being given bad input? Especially bad is that you don't tell us what function is generating these strings that you are working with, so we don't know what we are dependent upon. You mentioned (D.) and (F.) but those aren't standard functions, and you are not providing the source-code for them. There are myriad ways that strings representing numbers could be generated --- does your code support cases in which there is no decimal point, for example? > The application was intended > to convert string output from my floating-point package. Were integers > my only consideration the following would have sufficed: > > \ Comma formatted numeric output > \ Adapted from code by C.Curley FD15/5 > > \ like #S but inserts commas after each 3 digits > : #,S ( ud -- 0. ) > 0 begin >r # 2dup or while > r> 1+ dup 3 = if [char] , hold drop 0 then > repeat r> drop ; That is pretty good code. I think that it is a good idea to have a function that works with doubles and another function that works with floats. Remember the "universal processor" cartoon in the "Thinking Forth" book? Avoid writing overly general functions --- "Let the dictionary do the deciding." > > Also, he wrote a really long > > function that badly needed factoring. This is very novice-level Forth. > > If you guys were the experts that you claim to be, you would be > > helping him to improve his Forth. Instead the Beez congratulates him > > on his "clean" code and says that it qualifies for inclusion in the > > 4TH compiler, and the whole crowd immediately launches into a > > discussion of ones-complement arithmetic. What??? The poor guy is not > > going to learn anything about Forth from you guys --- I predict that > > he is going to drop Forth pretty soon, just like everybody else who > > tries to learn it. > > A novice after 25 years! If being a novice means there is still > something I can learn, well that sounds like a good thing. Sorry; I didn't know that you had been a Forther for 25 years. I just assumed that you were a novice because your code was badly designed and badly factored, and you were presenting a trivial function all by itself for us to look at and comment on. Try writing something comparable to my novice package to convince us that you are an expert --- a single tiny function doesn't make much of a blip on the radar screen (I've already spent more time on this thread than the amount of time that I spent writing BIG.). > Better > to be a novice than an "expert" who's constantly in fear of being > upstaged. Personally I can't think of anything more exciting than > to discover something which I had believed to be true, turns out > false. The trick is to never hitch one's wagon to anything so > permanently that it destroys one when the time comes to let it go. > For me, Forth is just such a thing. All of this inspirational talk is nonsense. The ANS-Forth standard was a complete failure. It should have standardized basic code such as the conversion of floats to strings. It is ridiculous that the Forth application programmers should have to write code like this ourselves (especially in the year 2012). Writing a program that generates an ascii file containing numeric data seems like a pretty common and mundane job. In any other language it would be easy. In AMS-Forth, the programmer is required to write his own function to convert a float into a string. Writing a program in ANS-Forth is somewhat like building a cabin using only an axe, just like the pioneers did in the 1800s. You know, this might be the reason why ANS-Forth did not become popular for application programming --- do you think? But hey --- it is only 2012, so it is not too late for us to finally write some code to convert floats into strings (actually I wrote SCIENTIFIC and ENGINEERING in 2010, but nobody noticed so we are still dinking around with this stuff in 2012).
[toc] | [prev] | [next] | [standalone]
| From | "WJ" <w_a_x_man@yahoo.com> |
|---|---|
| Date | 2012-03-03 03:45 +0000 |
| Message-ID | <jis44k02s6r@enews6.newsguy.com> |
| In reply to | #9763 |
hughaguilar96@yahoo.com wrote: > Writing a program that generates an ascii file containing numeric data > seems like a pretty common and mundane job. In any other language it would > be easy. In AMS-Forth, the programmer is required to write his own function > to convert a float into a string. Writing a program in ANS-Forth is > somewhat like building a cabin using only an axe, just like the pioneers > did in the 1800s. You know, this might be the reason why ANS-Forth did not > become popular for application programming --- do you think? > > But hey --- it is only 2012, so it is not too late for us to finally write > some code to convert floats into strings (actually I wrote SCIENTIFIC and > ENGINEERING in 2010, but nobody noticed so we are still dinking around with > this stuff in 2012). It is too late for the boneheads here. They desperately insist on keeping Forth a very low-level language that is useful only for programming an embedded controller that flushes a toilet.
[toc] | [prev] | [next] | [standalone]
| From | "Ed" <nospam@invalid.com> |
|---|---|
| Date | 2012-03-04 20:49 +1100 |
| Message-ID | <jivdmm$n1m$2@news-01.bur.connect.com.au> |
| In reply to | #9763 |
hughaguilar96@yahoo.com wrote:
> On Tuesday, February 28, 2012 11:20:50 PM UTC-7, Ed wrote:
> ...
> > A novice after 25 years! If being a novice means there is still
> > something I can learn, well that sounds like a good thing.
>
> Sorry; I didn't know that you had been a Forther for 25 years. I just assumed
> that you were a novice
> because your code was badly designed and badly factored, and you were
> presenting a trivial function all by
> itself for us to look at and comment on. Try writing something comparable to
> my novice package to convince
> us that you are an expert --- a single tiny function doesn't make much of a blip
> on the radar screen (I've
> already spent more time on this thread than the amount of time that I spent
> writing BIG.).
> ...
Anyone posting code on c.l.f. takes the risk of being attacked, but
even I'm amazed at the frenzy and ferocity of yours - particularly
as I've said little or nothing concerning Novice.4th.
While impossible to please everyone, the complaints levelled
thus far strike me as over-the-top if not hypocritical.
I've seen the code forthers write. I've seen the code Forth Inc
and MPE write. In virtually every case factoring is done out of
necessity - to extract or isolate a function, ease debugging,
or just because the definition got too big to handle.
I see definitions consisting of 5 and more lines all the time.
Here's one of them. It should be familiar.
: <scientific> { prec engineering? | sgn exp -- adr cnt } \ float: n --
prec 1 < abort" *** F>STRING needs a precision parameter >= 1 ***"
prec exponent to exp
engineering? if
begin exp 3 mod while 10.e f* -1 +to exp -1 +to prec repeat
fdup fabs prec round-off
1000.e f>= if 1000.e f/ 3 +to exp 3 +to prec then
then
prec 1 ?do 10.e f* loop
fnear f>d
dup to sgn dabs <# bl hold
exp #exponent
true to ~#soft prec 1 ?do ~# loop ~.
2dup or if #s
else ~#soft if #s then then
sgn sign #> ;
> But hey --- it is only 2012, so it is not too late for us to finally write
> some code to convert floats into
> strings (actually I wrote SCIENTIFIC and ENGINEERING in 2010,
> but nobody noticed so we are still dinking
> around with this stuff in 2012).
Should a novice try it ...
SwiftForth:
1e 3e f/ 9 false <scientific> type 3.33333333e-1 ok
1e 3e f/ 10 false <scientific> type 3.333333333e-1 ok
1e 3e f/ 11 false <scientific> type 3.3333333333e-1 ok
1e 3e f/ 12 false <scientific> type INTEGER_OVERFLOW
he might wonder whether he made the right choice of language.
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2012-03-04 15:16 +0100 |
| Message-ID | <4f5378ed$0$6928$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #9831 |
Ed wrote: > Anyone posting code on c.l.f. takes the risk of being attacked, but > even I'm amazed at the frenzy and ferocity of yours - particularly > as I've said little or nothing concerning Novice.4th. Well, that's Hugh for you. But there are lots of entrenched, grumpy old men here in c.l.f. Fortunately, there are other resources than c.l.f where I don't see the same attitude. But most likely lots of novices are scared away when they view that level of discussion. > While impossible to please everyone, the complaints levelled > thus far strike me as over-the-top if not hypocritical. We have a saying in Holland "People see the splinters in the eyes of the other, but not the enormous pole in their own.". As you so perfectly demonstrated. Yes, it's sometimes hard to write GOOD Forth code. Yes, sometimes you're unable to keep the stack shallow. But hey, we're humans we try. And if my code doesn't appeal to you then DON'T USE IT. > I've seen the code forthers write. I've seen the code Forth Inc > and MPE write. In virtually every case factoring is done out of > necessity - to extract or isolate a function, ease debugging, > or just because the definition got too big to handle. > I see definitions consisting of 5 and more lines all the time. > he might wonder whether he made the right choice of language. I have to say it again and again, there is little Forth code I really like. I could probably say something about anyones code here. But after I've burned down anyone, is there something left to cooperate with? And let's face it: sometimes code is just plain useful. You and I know we discussed some constructs on your FPIN and FPOUT in detail. We also discussed some choices I made when I designed 4tH. But in the end 4tH had its ANS compliant float I/O words, you could add another supporting compiler to your list and my users were the ones that really benefitted. Without picking on someone - Brad Eckerts FP code was fairly buggy and I had to eradicate a lot of bugs, but it is beautiful stuff, fast and precise. I tend to think we forget about that sometimes. We're few fish in a small bowl - why do we have to fight all the time? Hans Bezemer
[toc] | [prev] | [next] | [standalone]
| From | "Ed" <nospam@invalid.com> |
|---|---|
| Date | 2012-03-06 15:06 +1100 |
| Message-ID | <jj42bd$3e4$2@news-01.bur.connect.com.au> |
| In reply to | #9834 |
Hans Bezemer wrote: > ... > Without picking on someone - Brad Eckerts FP code was fairly buggy and I had > to eradicate a lot of bugs, but it is beautiful stuff, fast and precise. > Yes. I've seen Brad's code and was surprised one could all that he did in such a small amount of code!
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2012-03-06 08:32 +0100 |
| Message-ID | <4f55bd34$0$6905$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #9873 |
Ed wrote: > Hans Bezemer wrote: >> ... >> Without picking on someone - Brad Eckerts FP code was fairly buggy and I >> had to eradicate a lot of bugs, but it is beautiful stuff, fast and >> precise. >> > > Yes. I've seen Brad's code and was surprised one could all that he did > in such a small amount of code! You haven't seen 4tH's other FP library, Zen FP. It uses a shared stack, but is a lot smaller. Note it supports the same range of ANS FP wordset in the meanwhile, including your FPIN, FPOUT, REPRESENT. I prefer it for development, because it's so much easier to handle. Not ANS 200x compiliant though, and slower. Hans Bezemer
[toc] | [prev] | [next] | [standalone]
| From | Hugh Aguilar <hughaguilar96@yahoo.com> |
|---|---|
| Date | 2012-03-05 15:06 -0800 |
| Message-ID | <df731d03-04ba-455b-a705-34d35e7370f5@w23g2000yqb.googlegroups.com> |
| In reply to | #9831 |
On Mar 4, 2:49 am, "Ed" <nos...@invalid.com> wrote:
> hughaguila...@yahoo.com wrote:
> > On Tuesday, February 28, 2012 11:20:50 PM UTC-7, Ed wrote:
> > ...
> > > A novice after 25 years! If being a novice means there is still
> > > something I can learn, well that sounds like a good thing.
>
> > Sorry; I didn't know that you had been a Forther for 25 years. I just assumed
> > that you were a novice
> > because your code was badly designed and badly factored, and you were
> > presenting a trivial function all by
> > itself for us to look at and comment on. Try writing something comparable to
> > my novice package to convince
> > us that you are an expert --- a single tiny function doesn't make much of a blip
> > on the radar screen (I've
> > already spent more time on this thread than the amount of time that I spent
> > writing BIG.).
> > ...
>
> Anyone posting code on c.l.f. takes the risk of being attacked, but
> even I'm amazed at the frenzy and ferocity of yours - particularly
> as I've said little or nothing concerning Novice.4th.
>
> While impossible to please everyone, the complaints levelled
> thus far strike me as over-the-top if not hypocritical.
I apologize for "attacking" you. I do think that converting a number
into a string and then manipulating the string, is bad design.
Saying so wasn't meant as an attack though. I'm actually very
impressed that you are writing Forth code. By writing even a single
Forth function, you have written infinitely more Forth code than many
of the long-time comp.lang.forth enthusiasts --- I mean Gavino,
Passaniti and Elizabeth Rather, who endlessly discuss the *concept* of
Forth programming but who never actually write any Forth code (I still
have hope for Gavino though).
> I've seen the code forthers write. I've seen the code Forth Inc
> and MPE write. In virtually every case factoring is done out of
> necessity - to extract or isolate a function, ease debugging,
> or just because the definition got too big to handle.
> I see definitions consisting of 5 and more lines all the time.
> Here's one of them. It should be familiar.
>
> : <scientific> { prec engineering? | sgn exp -- adr cnt } \ float: n --
> prec 1 < abort" *** F>STRING needs a precision parameter >= 1 ***"
> prec exponent to exp
> engineering? if
> begin exp 3 mod while 10.e f* -1 +to exp -1 +to prec repeat
> fdup fabs prec round-off
> 1000.e f>= if 1000.e f/ 3 +to exp 3 +to prec then
> then
> prec 1 ?do 10.e f* loop
> fnear f>d
> dup to sgn dabs <# bl hold
> exp #exponent
> true to ~#soft prec 1 ?do ~# loop ~.
> 2dup or if #s
> else ~#soft if #s then then
> sgn sign #> ;
Well, I admit that is big and ugly. In my documentation (http://
www.forth.org/novice.pdf) I said that the novice package is like
sausage in that you don't necessarily want to know how it is made. I
already said that some of the low-level code, such as the array
definers, was written more for speed than prettiness. As for
<SCIENTIFIC>, it was just something that I slapped together in order
to allow the slide-rule package to generate ascii files of raw data
for that guy writing the JavaScript emulator --- it was somewhat ugly,
and I never went back to pretty it up.
A bit part of the problem is that I am using local variables. If I
used global variables then I could factor my functions more. For
example, I did that in BIG. with the SGN item. For the most part
though, I dropped all use of global variables to make this stuff
reentrant.
> > But hey --- it is only 2012, so it is not too late for us to finally write
> > some code to convert floats into
> > strings (actually I wrote SCIENTIFIC and ENGINEERING in 2010,
> > but nobody noticed so we are still dinking
> > around with this stuff in 2012).
>
> Should a novice try it ...
>
> SwiftForth:
>
> 1e 3e f/ 9 false <scientific> type 3.33333333e-1 ok
> 1e 3e f/ 10 false <scientific> type 3.333333333e-1 ok
> 1e 3e f/ 11 false <scientific> type 3.3333333333e-1 ok
> 1e 3e f/ 12 false <scientific> type INTEGER_OVERFLOW
>
> he might wonder whether he made the right choice of language.
Apparently you didn't notice the comment on the MAX-PREC constant:
10 constant max-prec
\ 11 works sometmes, but fails if the most significant digit is
large.
\ 10 always works.
: scientific ( -- adr cnt ) \ float: n --
precision false <scientific> ;
: max-scientific ( -- adr cnt ) \ float: n --
max-prec false <scientific> ;
: engineering ( -- adr cnt ) \ float: n --
precision true <scientific> ;
: max-engineering ( -- adr cnt ) \ float: n --
max-prec true <scientific> ;
This limitation is due to my converting the float into a double
integer. For the most part, it is not a problem. Unless you are
guiding a spaceship to Pluto, you don't really need more than 10
digits of precision. Pluto is not a planet anyway, so to heck with it!
A more valid complaint is that I didn't mention the fact that this
stuff doesn't work on a 16-bit ANS-Forth system. I did make a note of
that in regard to the random-number stuff, but forgot to mention it
here.
[toc] | [prev] | [next] | [standalone]
| From | "Ed" <nospam@invalid.com> |
|---|---|
| Date | 2012-03-06 15:03 +1100 |
| Message-ID | <jj42bc$3e4$1@news-01.bur.connect.com.au> |
| In reply to | #9867 |
Hugh Aguilar wrote: > ... > I do think that converting a number > into a string and then manipulating the string, is bad design. It's a method - one that's regularly employed by practitioners of other languages. Every method has its issues. I chose it because I didn't want to complicate my existing f/p output functions for something I'll use only sometimes. As it was portable, I posted it for others that might be interested with a note it was "no frills" code. > > Apparently you didn't notice the comment on the MAX-PREC constant: > > 10 constant max-prec > \ 11 works sometmes, but fails if the most significant digit is > large. > \ 10 always works. > > ... > This limitation is due to my converting the float into a double > integer. For the most part, it is not a problem. Unless you are > guiding a spaceship to Pluto, you don't really need more than 10 > digits of precision. Pluto is not a planet anyway, so to heck with it! I did see the comment. The issue is that you are promoting your functions as the solution to ANS' lack of f/p string functions. While 10 digits may suffice many applications, it falls well short of the 15+ digits of which double-precision is capable.
[toc] | [prev] | [next] | [standalone]
| From | hwfwguy@gmail.com |
|---|---|
| Date | 2012-03-06 20:29 -0800 |
| Message-ID | <18570120.1147.1331094549957.JavaMail.geo-discussion-forums@vbxv4> |
| In reply to | #9867 |
On Monday, March 5, 2012 4:06:37 PM UTC-7, Hugh Aguilar wrote: > I mean Gavino, > Passaniti and Elizabeth Rather, who endlessly discuss the *concept* of > Forth programming but who never actually write any Forth code Maybe someday Elizabeth will write some Forth code. Who knows, she may even teach a class about Forth and eventually write a book about Forth programming. I like to see the glass as half full.
[toc] | [prev] | [next] | [standalone]
| From | Hugh Aguilar <hughaguilar96@yahoo.com> |
|---|---|
| Date | 2012-03-06 23:18 -0800 |
| Message-ID | <b1a02e09-e5fa-4d94-9752-01f7b0e948df@q18g2000yqh.googlegroups.com> |
| In reply to | #9903 |
On Mar 6, 9:29 pm, hwfw...@gmail.com wrote: > On Monday, March 5, 2012 4:06:37 PM UTC-7, Hugh Aguilar wrote: > > I mean Gavino, > > Passaniti and Elizabeth Rather, who endlessly discuss the *concept* of > > Forth programming but who never actually write any Forth code > > Maybe someday Elizabeth will write some Forth code. Who knows, she may even teach a class about Forth and eventually write a book about Forth programming. I like to see the glass as half full. When I bought my copy of SwiftForth, I also bought both of Elizabeth Rather's books. They are pretty thin on actual code! You can't fool me with all of this baloney --- she is not a programmer at all --- she is a salesperson and nothing more. You may see the glass as half full. Well, my wallet was completely empty after wasting all of that money and getting essentially nothing in return. SwiftForth would be a lot more amusing if it were a public domain project. If it was a shareware compiler with a $30 registration fee, I would consider that to be a fair price. To present something like SwiftForth as a professional development system, with a cost of upwards of $500 however --- that just isn't amusing at all. I can defeat Forth Inc.. My Straight Forth will a real development system that will get taken seriously in the real world. That will hopefully be the end of Forth Inc. forever.
[toc] | [prev] | [next] | [standalone]
| From | John Passaniti <john.passaniti@gmail.com> |
|---|---|
| Date | 2012-03-07 06:07 -0800 |
| Message-ID | <cc4f921f-a2fb-4438-a062-c230002f6f95@t16g2000yqt.googlegroups.com> |
| In reply to | #9907 |
On Mar 7, 2:18 am, Hugh Aguilar <hughaguila...@yahoo.com> wrote: > I can defeat Forth Inc.. My Straight Forth will a real > development system that will get taken seriously in the > real world. That will hopefully be the end of Forth Inc. forever. Can you provide a rough timeframe or development roadmap for your Forth? I'd imagine that unlike most of us, you have plenty of time to work on this.
[toc] | [prev] | [next] | [standalone]
| From | hwfwguy@gmail.com |
|---|---|
| Date | 2012-03-07 06:36 -0800 |
| Message-ID | <10561640.6885.1331130990844.JavaMail.geo-discussion-forums@ynnk21> |
| In reply to | #9907 |
On Wednesday, March 7, 2012 12:18:58 AM UTC-7, Hugh Aguilar wrote: > I can defeat Forth Inc.. My Straight Forth will a real development > system that will get taken seriously in the real world. That will > hopefully be the end of Forth Inc. forever. Are you pondering what I'm pondering? It's true that you can beat SwiftForth, but you have to stand on the shoulders of giants to do it. Is that you? The Forth companies would be out of business if all they did was sell Forths. No, the real money is in using Forth. They could follow the Red Hat business model and come out ahead. Write one Forth to get it out of your system, then go back and closely study all of the good Forths you can find. If you want a PD Forth, start with an existing one, take it apart and build something better with the pieces. -Brad
[toc] | [prev] | [next] | [standalone]
| From | Hugh Aguilar <hughaguilar96@yahoo.com> |
|---|---|
| Date | 2012-03-07 16:19 -0800 |
| Message-ID | <4b019911-47fd-4348-b2a1-65224c780953@q18g2000yqh.googlegroups.com> |
| In reply to | #9911 |
On Mar 7, 7:36 am, hwfw...@gmail.com wrote: > On Wednesday, March 7, 2012 12:18:58 AM UTC-7, Hugh Aguilar wrote: > > I can defeat Forth Inc.. My Straight Forth will a real development > > system that will get taken seriously in the real world. That will > > hopefully be the end of Forth Inc. forever. > > Are you pondering what I'm pondering? It's true that you can beat SwiftForth, but you have to stand on the shoulders of giants to do it. Is that you? > > The Forth companies would be out of business if all they did was sell Forths. No, the real money is in using Forth. They could follow the Red Hat business model and come out ahead. > > Write one Forth to get it out of your system, then go back and closely study all of the good Forths you can find. If you want a PD Forth, start with an existing one, take it apart and build something better with the pieces. > > -Brad What giants? Give me an example. I would be more than happy to use a PD Forth rather than write my own from scratch --- if only there was one. I have examined both Gforth and Win32Forth so far, and neither is any good. My real contribution is that I know how to write a cross- compiler --- I don't particularly want to write a desktop-computer Forth, although that is what I'm doing right now --- I need a desktop- computer Forth as a platform for the cross-compiler. Actually, the real money is in selling hardware. The bean counters need something physical to count, and circuit boards fit the bill. It is possible to follow the Red Hat model and come out ahead --- the whole point (to paraphrase Nathan Forrest) is to be "the firstest with the mostest" in the circuit-board market --- the customers don't really care what language the firmware is written in.
[toc] | [prev] | [next] | [standalone]
| From | Albert van der Horst <albert@spenarnc.xs4all.nl> |
|---|---|
| Date | 2012-03-08 10:51 +0000 |
| Message-ID | <m0kbhd.n6v@spenarnc.xs4all.nl> |
| In reply to | #9924 |
In article <4b019911-47fd-4348-b2a1-65224c780953@q18g2000yqh.googlegroups.com>, Hugh Aguilar <hughaguilar96@yahoo.com> wrote: <SNIP> > >What giants? Give me an example. I would be more than happy to use a >PD Forth rather than write my own from scratch --- if only there was >one. I have examined both Gforth and Win32Forth so far, and neither is >any good. I agree that neither of the two are starting points. They are full blown systems intended to be usable. If you don't like them, don't use them, or you're swimming against the tide. My first version of ciforth was figForth 86. My first version of my manual was a bootleg of the figForth manual. I had a version that I could test against the ISO 94 specification in months. So yes, giants. >My real contribution is that I know how to write a cross- >compiler --- I don't particularly want to write a desktop-computer >Forth, although that is what I'm doing right now --- I need a desktop- Same situation. I got a lot of inspiration about how to write low level stuff (on micro's that don't have division etc.) from Brad Rodriguez Forth's (CamelForth). So yes, giants. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
[toc] | [prev] | [next] | [standalone]
| From | Doug Hoffman <glidedog@gmail.com> |
|---|---|
| Date | 2012-02-15 20:18 -0500 |
| Message-ID | <4f3c5982$0$281$14726298@news.sunsite.dk> |
| In reply to | #9523 |
On 2/13/12 5:24 AM, Ed wrote: > : COMMA$ ( a1 u1 -- a2 u2 ) > <# > begin dup while > string/c dup hold [char] . = > until then > cnt off > begin dup while > string/c > dup [char] 0 - 10 u< cnt @ 3 = and > if [char] , hold cnt off then > hold 1 cnt +! > repeat > #> ; Took me awhile to realize that "[char] 0 - 10 u<" was a test for valid numeral. Equivalent to "[char] 0 [char] 9 1+ within" I think. Might be a useful factor: : numeral? ( char -- f ) [char] 0 - 10 u< ; > s" !#$%'()*+-." comma$ cr type Were you attempting to filter *all* garbage input? Not suggesting that you should. s" !#$%'(4*+-." comma$ cr type -Doug
[toc] | [prev] | [next] | [standalone]
| From | "Ed" <nospam@invalid.com> |
|---|---|
| Date | 2012-02-17 12:29 +1100 |
| Message-ID | <jhkad6$a7a$1@news-01.bur.connect.com.au> |
| In reply to | #9583 |
Doug Hoffman wrote: > ... > Took me awhile to realize that "[char] 0 - 10 u<" was a test for valid > numeral. Equivalent to "[char] 0 [char] 9 1+ within" I think. Might be > a useful factor: > > : numeral? ( char -- f ) [char] 0 - 10 u< ; I thought the same too! I called it DIGIT? and added it to my library. The definition is dependent on 2's complement. I considered WITHIN but it looked clumsy. I was going to define BETWEEN but the definition above turned out simpler - and even readable :) > > > s" !#$%'()*+-." comma$ cr type > > Were you attempting to filter *all* garbage input? Not suggesting that > you should. Just intended to show formatting required the presence of both decimal point and decimal digits.
[toc] | [prev] | [next] | [standalone]
| From | BruceMcF <agila61@netscape.net> |
|---|---|
| Date | 2012-02-17 09:42 -0800 |
| Message-ID | <0e68f64d-7e0c-445e-a3d3-7b17d4e2db28@18g2000yqe.googlegroups.com> |
| In reply to | #9591 |
On Feb 16, 8:29 pm, "Ed" <nos...@invalid.com> wrote: > Doug Hoffman wrote: > > : numeral? ( char -- f ) [char] 0 - 10 u< ; > I thought the same too! I called it DIGIT? and added it to my > library. The definition is dependent on 2's complement. Why wouldn't it work in one's complement? Isn't '0' subtracted from an ascii code one less than it "-1", which is $FE bit extended up? It looks fine to me for ASCII7, or 8bit code pages based on ASCII7. Isn't it good for a single Unicode code point as well (assuming sufficient cell width)? Don't know about signed-magnitude, but I don't see why its problematic for either complement encoding.
[toc] | [prev] | [next] | [standalone]
Page 4 of 8 — ← Prev page 1 2 3 [4] 5 6 7 8 Next page →
Back to top | Article view | comp.lang.forth
csiph-web