[Factor-talk] traslation

2011-08-21 Thread Arkady Rost
Hi! I'm looking for a more elegant solution of the following task.

for i in rangeA {
for j in rangeB {
foo(param, i, j);
}
bar();
}

I need to translate this to factor.

foo(param, y, x) <=> x y param foo

I have a solution:
rangeA rangeB param [ foo ] curry [ swapd [ call ] 2curry each bar ] 2curry
each

For example,
rangeA = { "a" "b" "c" }
rangeB = { "1" "2" "3" }
param = " "
foo = append append write ;
bar = "" print ;

{ "a" "b" "c" } { "1" "2" "3" }  " " [ append append write ] curry [ swapd [
call ] 2curry each "" print ] 2curry each

Result is :
1a 2a 3a
1b 2b 3b
1c 2c 3c

I think my solution is bloated with partial applications. Maybe someone can
provide a better way to solve this task.

Cheers,
Ark. Rost
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] traslation

2011-08-21 Thread Arkady Rost
The original task is more complicated that's why I've used foo and bar in
definition of the problem. Thanks for attention but I'm looking for a better
solution in the general case.
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] traslation

2011-08-21 Thread Arkady Rost
Thanks for all ideas. They are really helpful. Now I have a lot of things to
think about.
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] some questions

2011-11-03 Thread Arkady Rost
Hi! I have two questions.

1) How to declare a stack effect for such function?
: foo ( ?? -- ??? ) dup 5 = [ ] [ drop foo ] if ; inline recursive

2) How the word with-compilation-unit applies changed words?
It's invoked with with-scope word witch discards any variable set by the
quotation.

Cheers,
Arkady Rost
--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] stack effect

2012-03-02 Thread Arkady Rost
Hi!
Today I was trying to write some factor code and it turned out that I can
write such code:
*1 5 4 3 2 [ 5 = not ] loop*
It works and produces stack with one element 1. I expect that at least I
would have a warning because loop word takes quotation with ( ... -- ... ?
) stack effect. In the example I use quotation with ( x -- x ) stack
effect. So what I am missing?

Cheers,
   Arkady Rost
--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] factorcode is down?

2013-07-06 Thread Arkady Rost
Hello, factorians!

What's happening with factorcode.org? I've got the message that "This
webpage is not available".

Best wishes,
Arkady Rost.
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk