1

I want to play around with clay a little but I did not figure out how to get the output to display on the console. Is there any library function I could use? And related to this question: where can i find some documentation?

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
Byakkun
  • 97
  • 10

1 Answers1

3

It looks as though the println function should do what you want. It is implicitly imported from a standard library.

println("Hello, World!");

Documentation seems sparse, but there is a wiki.

This looks like and interesting language. Thank you for pointing it out.

Edit: Here is a little example I whipped up for console input.

main() {
    println("What is your name: ");
    var name = readLine(stdin);
    println("Hello, ", name);
}

It looks like the best source of information is the source code of the bundled libraries. In this case, I looked at io/streams/streams.clay

Kevin A. Naudé
  • 3,992
  • 19
  • 20
  • They link to the bitbucket repo so I have missed this wiki. Thanks for sharing! About the println() function - I have used it - but I was hoping that I can display it's output somehow. In other words I have not found the equivalent of C's getch() or cin.get(). – Byakkun Jan 31 '11 at 12:53
  • @Byakkun: I wasn't entirely sure what you meant, but I've edited my response to include an example of console input - in case it helps. – Kevin A. Naudé Jan 31 '11 at 14:01