How to print to console?

10 views
Skip to first unread message

Yves Cloutier

unread,
Nov 25, 2017, 7:00:18 PM11/25/17
to pure-lang
This seems like a silly question, put how do I print to the console?

I've seen puts in some examples, but doesn't seem to do anything for me.

I'm trying out an example from the CSV parser documentation, but using my own CS file:

using csv;
using namespace csv;
let d
= dialect {quote_flag=>MINIMAL};
let f
= open ("books.csv", "r", d, [LIST,HEADER]);
let r
= getr f;
puts r
!0;
let k
= header f;
puts k
;
puts r
!(k!"title");
puts r
!!(k!!["title","list_price"]);


Any pointers would be helpful.

Eddie Rucker

unread,
Nov 25, 2017, 7:02:38 PM11/25/17
to pure...@googlegroups.com
You need to have system imported, i.e.,

Using system, csv;

Puts is defined in system.



Sent via the Samsung Galaxy Note® 4, an AT&T 4G LTE smartphone
--
You received this message because you are subscribed to the Google Groups "pure-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+...@googlegroups.com.
To post to this group, send email to pure...@googlegroups.com.
Visit this group at https://groups.google.com/group/pure-lang.
For more options, visit https://groups.google.com/d/optout.

Albert Graef

unread,
Nov 25, 2017, 9:41:21 PM11/25/17
to pure...@googlegroups.com
Also, puts(r!0) is probably what you want, as puts r!0 will be parsed as (puts r)!0 (function application binds stronger than any operator).

Also, note that if you want to print any kind of data which is not a string, you'll need to convert it to a string first: puts (str x).

To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+unsubscribe@googlegroups.com.

To post to this group, send email to pure...@googlegroups.com.
Visit this group at https://groups.google.com/group/pure-lang.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "pure-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+unsubscribe@googlegroups.com.

To post to this group, send email to pure...@googlegroups.com.
Visit this group at https://groups.google.com/group/pure-lang.
For more options, visit https://groups.google.com/d/optout.



--
Dr. Albert Gr"af
Computer Music Research Group, JGU Mainz, Germany
Email:  agg...@gmail.com
WWW:    https://plus.google.com/+AlbertGraef

Yves Cloutier

unread,
Nov 26, 2017, 10:49:31 AM11/26/17
to pure-lang
Thank you both for your help, I knew I was missing something obvious!
To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+...@googlegroups.com.

To post to this group, send email to pure...@googlegroups.com.
Visit this group at https://groups.google.com/group/pure-lang.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "pure-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+...@googlegroups.com.

To post to this group, send email to pure...@googlegroups.com.
Visit this group at https://groups.google.com/group/pure-lang.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages