On Friday 04 July 2008 11:08:40 Joe Groff wrote:
> That's cool, Ed. I didn't know that. Having that feature in cleave
> would also make get-slots redundant.
By the way, the technique I described earlier for accomplishing this isn't the
only way.
Here's what happens if you try to use cleave with a sequence of words:
3 { 1+ 1- 2^ } cleave
Generic word call does not define a method for the word class.
Allowed classes: { quotation curry compose }
Dispatching on object: 1+
Type :help for debugging help.
The key point: call doesn't work on words.
This is Factor, we can fix that:
M: word call execute ;
... wait a while
Now try again, this time with feeling:
( scratchpad) 3 { 1+ 1- 2^ } cleave
----------
4
2
8
----------
OK, so by adding a method on 'call' for words, you get this behaviour for free
across all such combinators.
We've discussed this possibility in the past. I'm currently against making
this change. I'm against these kinds of low level changes without careful
consideration and consensus in the *developing* community that this won't
break things. That's to say, if you haven't coded substantially in Factor,
and we're the judge of what is substantial, then you don't affect the
consensus. Keep that in mind before you "vote". :-)
So get analyzing. If we can prove that adding this method won't wreak havoc,
it will move into the realm of possibility.
Some folks might be thinking, "wtf? this guy is all about the wacky gizmo
experimental stuff one day and all prudish the next". I'm all for the
experiments when they can be isolated in a vocabulary and used optionally.
This sort of change is forced on everyone so I'm much more conservative about
things like this.
>From a language semantics standpoint, this is an interesting case. Sure you
could stick the method in a separate vocabulary. But once you load it, it
impacts everything. This is a drawback of generic words. It would be
interesting if the semantics of generic words were such that you could say:
In this vocabulary, add these methods to this generic word
And those additional methods would only apply in that vocabulary.
Additionally you could say,
Whoever uses this vocabulary get's their view of 'blah' generic word
endowed
with these methods...
Solve this and you get an honorary PhD from Concatenative University.
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