Play around with Snobol and Infiqs

1 2 3 Page 3
Page 3 of 3


Most of the previous Java Fun and Games installments have presented homework for you to accomplish; this installment is no different. To reinforce this article's content, I've prepared the following questions and exercises, which will help you become even better acquainted with the Infiqs macro expander and the Snobol3 language interpreter:

  • What is wrong with the dec x = "1" + 2 ; macro? Why is this wrong?
  • Infiq uses ^ for its exponentiation operator. What other exponentiation syntax is supported?
  • Snobol3 includes the built-in CALL(s) function for dynamically invoking a function identified by string s. Use this function to invoke Listing 6's FACT(n) function, with 6 as the value of n.
  • Extend the Snobol3 language interpreter with built-in LCASE(s) and UCASE(s) functions. Each function has a single string parameter (s) and returns a string. Can you write these functions as user-defined functions (assume that the interpreter hasn't been enhanced)?

I downloaded the Infiqs macro expander and the Snobol3 language interpreter from the Programming Languages for the Java Virtual Machine Website. This Website provides links to more than 200 third-party products that evolve Java in various ways. After you finish playing with Infiqs and Snobol3, I recommend that you check out these other Javalution products.

Jeff Friesen is a freelance software developer and educator specializing in C, C++, and Java technology.

Learn more about this topic

This story, "Javalution" was originally published by JavaWorld.

Copyright © 2006 IDG Communications, Inc.

1 2 3 Page 3
Page 3 of 3