Re: Elementary but surprisingly difficult.
- From: Albert van der Horst <albert@xxxxxxxxxxxxxxxxxx>
- Date: 25 May 2008 09:39:06 GMT
In article <d9ff9$4838be72$cdd0851a$13182@xxxxxxxxxxxxx>,
Doug Hoffman <dhoffman@xxxxxxxxxxxxxxx> wrote:
Slava Pestov wrote:
On May 24, 4:36 pm, Bernd Paysan <bernd.pay...@xxxxxx> wrote:
: uniquify ( addr u -- addr u' )
over >r bounds dup dup c@ 2swap 1+ ?DO
I c@ tuck <> IF swap 1+ 2dup c! swap THEN LOOP
drop r> swap over - ;
This is why stack-based languages have a reputation of unreadability.
I both agree and disagree with you in this case. It is not the kind of
code I would normally write, especially if in a hurry to get the job
done. Of course I could spend the time to pick it apart and see exactly
what is going. But why bother? The word works. Some people, like
Bernd, can probably glance at code like this and easily/quickly see
exactly what makes it tick. I am not one of those people, even though I
like and use Forth.
No it doesn't work for me. It is hard to understand that using it
for what I want is very hard.
(Compare this to C : pc++ , now pc point to a struct instead of
a char, no sweat).
I will hang on to 'uniquify' because I can see where it could be useful
to me in the future. (Thanks Bernd!).
-Doug
--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
.
- References:
- Elementary but surprisingly difficult.
- From: Albert van der Horst
- Re: Elementary but surprisingly difficult.
- From: Bernd Paysan
- Re: Elementary but surprisingly difficult.
- From: Slava Pestov
- Re: Elementary but surprisingly difficult.
- From: Doug Hoffman
- Elementary but surprisingly difficult.
- Prev by Date: Re: Elementary but surprisingly difficult.
- Next by Date: Re: Elementary but surprisingly difficult.
- Previous by thread: Re: Elementary but surprisingly difficult.
- Next by thread: Re: Elementary but surprisingly difficult.
- Index(es):
Relevant Pages
|