Re: [Factor-talk] Managing many vocabularies

2012-11-30 Thread Leon Konings
Hi John and Alexander, Thanks for the very useful advice. I prefer not to use DEFER: (pun intended), but if it turns out to be the best solution I will. Best regards, Leon Konings Quoting John Benediktsson mrj...@gmail.com: Alex has good advice. In addition, if you have a circularity

[Factor-talk] embedding factor

2012-11-30 Thread Naveen Garg
Hey guys, I am playing around with factor again, and getting some useful work done. I am trying to use factor embedded... Unfortunately, the function init_factor_from_args that is mentioned in the documentation is no longer in the source... There is a new function: start_standalone_factor in

Re: [Factor-talk] embedding factor

2012-11-30 Thread Michael Clagett
Also interested in this. Sent from my iPhone On Nov 30, 2012, at 3:25 PM, Naveen Garg naveen.g...@gmail.com wrote: Hey guys, I am playing around with factor again, and getting some useful work done. I am trying to use factor embedded... Unfortunately, the function init_factor_from_args

[Factor-talk] regexp words on string slices

2012-11-30 Thread Naveen Garg
Any reason slices are not allowed to be passed to regexp words like first-match ? I tried modifiying the word: : check-string ( string -- string ) ! Make this configurable ! dup string? [ String required throw ] unless ; dup dup string? swap regexp? or [ String required throw ]

Re: [Factor-talk] regexp words on string slices

2012-11-30 Thread Naveen Garg
Oops, I had a typo, i was checking for regexp? instead of slice? : check-string ( string -- string ) ! Make this configurable !dup string? [ String required throw ] unless ; dup dup string? swap slice? or [ String required throw ] unless ; 0 4 foo bar slice R/ foo/

Re: [Factor-talk] regexp words on string slices

2012-11-30 Thread John Benediktsson
Probably the restrictions to strings were a performance optimization...? It should be pretty easy to get the behavior you want: IN: scratchpad 0 4 foo slice R/ foo/ first-match . T{ slice { from 0 } { to 3 } { seq foo } } Using this diff makes it work, but causes the regexp benchmark

Re: [Factor-talk] regexp words on string slices

2012-11-30 Thread Naveen Garg
Awesome. Thanks John. For my specific project, the current weaker link is memory usage compared to speed. On Fri, Nov 30, 2012 at 8:03 PM, John Benediktsson mrj...@gmail.com wrote: Probably the restrictions to strings were a performance optimization...? It should be pretty easy to get the