Hello, I am kind of embarrased for asking, but I am.  And, others from the 
imperative/procedural world may ask the same questions.  I am trying to 
convert some code to factor, but am having an issue with understanding how 
the stack works and how to manipulate and get values from it.  Say, for 
example; how would you convert this java code to factor.  I have an idea, but 
not 100%.

public class Test {
        public static String myTestInit(String arg0) {
                return "Testing: " + arg0;
        }
        public static String myTestWord(String arg1, String arg2, String 
arg3, String arg4) {

                System.out.println("Arg1: " + arg1);
                System.out.println("Arg2: " + arg2);
                System.out.println("Arg3: " + arg3);
                System.out.println("Arg4: " + arg4);
                return "myTestWord";
        }
        public static String myTestDriver(String arg2, String arg3, String 
arg4) {
                String res = myTestInit(null);
                myTestWord(res, arg2, arg3, arg4);
                return "myTestDriver";
        }
        public static void main(String [] args) {

                myTestDriver("Two", "Three", "Four");

        }
}

! Without the print statements
! If you want, could you put the 'prints' in there? hehe
: my-test-init ( x -- str )
        "Testing: " ;

: my-test-word ( x y z a -- str )
        "myTestWord" ;

: my-test-driver ( y z a -- str )
        [ f my-test-init ] y z a my-test-word ;

--
Berlin Brown
berlin dot brown at gmail dot com or 
bbrown at botspiritcompany dot com


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to