1

Some programming languages e.g. Pascal and Java have a keyword or standard library function e.g. print to output a value, and a separate name println to output with a newline, but this has the disadvantage of giving the shorter/more obvious name to the behavior you don't usually want.

Other languages e.g. Basic and Python use print for the behavior you do usually want and have a special syntax such as a trailing ; or , to suppress the newline when required. This works, but one could argue that it would be more elegant/transparent to have different names for the two behaviors.

Are there - or have there ever been - any languages where output of a value with newline is spelled print, and there is a separate name for output without newline?

4

1 回答 1

0

Tcl默认puts打印给定的字符串尾随的换行符,除非它传递了-nonewline命令行选项。

于 2013-04-12T17:30:53.933 回答