Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more print statements #15

Closed
TobiasWrigstad opened this issue Jul 20, 2014 · 9 comments
Closed

Add more print statements #15

TobiasWrigstad opened this issue Jul 20, 2014 · 9 comments

Comments

@TobiasWrigstad
Copy link
Contributor

We all know that the current print statement was added to facilitate "simple output and printline debugging". The current print story is this

print <integer>
print <string> 

Which means that if I want to print something like "Incorrect value: -123", I have to do it like so:

print "Incorrect value"
print -123

In the concurrent or parallel setting, this is fundamentally broken since multiple print statements can be interleaved. Thus, I propose adding at least two more print statements:

print <string>, <integer>
print <string>, <integer>, <string>, <integer>

They can of course be named something else for simplicity. Like print2 or print_str_int etc.

Naturally something better would be … well … better, but I guess then people will start saying it is too convenient. In any case, something better is needed.

@supercooldave
Copy link

Maybe we need to add a module into the system called Convenient,
and all functionality in this is added purely for convenience only,
with the understanding that it will be replaced one day be something
better designed (and hopefully more convenient).

(We don’t have modules.)

On 20 Jul 2014, at 13:26, TobiasWrigstad notifications@github.com wrote:

We all know that the current print statement was added to facilitate "simple output and printline debugging". The current print story is this

print
print
Which means that if I want to print something like "Incorrect value: -123", I have to do it like so:

print "Incorrect value"
print -123
In the concurrent or parallel setting, this is fundamentally broken since multiple print statements can be interleaved. Thus, I propose adding at least two more print statements:

print ,
print , , ,
They can of course be named something else for simplicity. Like print2 or print_str_int etc.

Naturally something better would be … well … better, but I guess then people will start saying it is too convenient. In any case, something better is needed.


Reply to this email directly or view it on GitHub.

Dave.Clarke@cs.kuleuven.be
Dept. of Computer Science
Celestijnenlaan 200A
B-3001 Heverlee
BELGIUM
Tel: +32 16 327866

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

@TobiasWrigstad
Copy link
Contributor Author

For the ultimate Heller experience, the Convenience module should also enable a module system!

I like the idea.
Perl has something called "use strict".
We could implement your idea as "enter easy mode".

@EliasC
Copy link
Contributor

EliasC commented Jul 20, 2014

How about printf? Which could translate into... printf?

@TobiasWrigstad
Copy link
Contributor Author

How about printf? Which could translate into... printf?

Yes! (Det vore en dröm och ett sken!)

@kaeluka
Copy link
Contributor

kaeluka commented Jul 21, 2014

One alternative would be to implement tuples. This would not let you format your output however you wish, but you could do:

print ("value=", 2)

The benefit would be that we'd have.. tuples!

@supercooldave
Copy link

Here here. Tuples are one thing we need, to be a proper language of modern times.

Sent from my iPhone

On 21/07/2014, at 11:23, Stephan Brandauer notifications@github.com wrote:

One alternative would be to implement tuples. This would not let you format your output however you wish, but you could do:

print ("value=", 2)

The benefit would be that we'd have.. tuples!


Reply to this email directly or view it on GitHub.

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

@kaeluka
Copy link
Contributor

kaeluka commented Jul 21, 2014

<3

@EliasC
Copy link
Contributor

EliasC commented Jul 31, 2014

There is a printf-statement as of 7518edd. Syntax is printf "x = {}, y = {}", x, y.

@EliasC EliasC closed this as completed Jul 31, 2014
@supercooldave
Copy link

Very rustique!

Sent from my iPhone

On 31/07/2014, at 15:00, EliasC notifications@github.com wrote:

There is a printf-statement as of 7518edd. Syntax is printf "x = {}, y = {}", x, y.


Reply to this email directly or view it on GitHub.

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants