01: /*
02: * @(#)println.java 1.2 04/12/06
03: *
04: * Copyright (c) 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package org.pnuts.lib;
10:
11: import pnuts.lang.*;
12: import java.io.*;
13:
14: public class println extends PnutsFunction {
15:
16: public println() {
17: super ("println");
18: }
19:
20: public boolean defined(int narg) {
21: return true;
22: }
23:
24: public Object exec(Object[] args, Context context) {
25: PrintWriter output = context.getWriter();
26: if (output != null) {
27: for (int i = 0; i < args.length; i++) {
28: output.print(args[i]);
29: }
30: output.println();
31: }
32: return null;
33: }
34:
35: public String toString() {
36: return "function println(args[])";
37: }
38: }
|