Hello,
We currently have suffix:
suffix ( seq obj -- seq )
I'm in favor of having:
suffix! ( seq obj -- seq )
which is equivalent to:
over push
and getting rid of push.
I'm also in favor of the corresponding:
prefix! ( seq obj -- seq )
The point is to get rid of another name to remember (push).
We can also get rid of 'push-all'. It should instead be:
append! ( a b -- ab )
Again, if a user knows about 'append', they should be able to guess that by
adding a bang, they'll get a mutating version.
We should remove one of 'delete' or 'remove'. Let's suppose we do away
with 'delete'. We'd then have:
remove ( seq obj -- seq )
remove! ( seq obj -- seq )
We'd free up the name 'delete' for some other usage.
We currently have 'delete-nth' and 'remove-nth' (in extra). We should remove
both and have:
pluck ( seq i -- seq )
pluck! ( seq i -- seq )
'change-each' should be:
map! ( seq quot -- seq )
We should remove 'peek' and have:
pop ( seq -- elt )
pop! ( seq -- elt )
We have 'delete-slice' but we don't have a functional version. Instead
of 'delete-slice' we should have:
snip ( seq a b -- seq )
snip! ( seq a b -- seq )
To all who will predicatably react to the use of bang in word names, I say,
get over it. You won't find a better solution. If we don't allow the bang, we
will have the current situation which is ludicrous. Note that I don't think
we're ludicrous for developing the library this way. It's been in a long
exploratory add-as-we-go phase. Inconsistency is a necessary byproduct of the
experimental phase. *Accepting* the current state as gospel is
what would be ludicrous. It's time to prune the hedges.
And to those who will predictably plead for these changes not to be made; too
late. They've been around for a while in 'newfx' and I'm already using them
in real code. For me, the future is now. What I'm lobbying for is for this
design to be considered for adoption into core.
Wake up sheeple!
;-)
If you're thinking of responding to this, please be more creative than "I
don't like it". I'm only interested in responses which contain even better
designs. I don't think there will be any.
Ed
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk