Loops/N plus one half: Difference between revisions

added common lisp and ruby
(added common lisp and ruby)
Line 87:
}
</cfscript>
 
=={{header|Common Lisp}}==
<lisp>(loop for i from 1 upto 10 do
(princ i)
(if (= i 10) (return))
(princ ", "))</lisp>
 
=={{header|D}}==
Line 266 ⟶ 272:
 
Note: this example uses the Python idiom of building a string as a list and joining the parts together (on an empty string) which is generally far more efficient than instantiating new strings at every step along the way. (Strings are immutable so each expression using "some string" + "some other string" is building new objects rather than appending to existing ones).
 
=={{header|Ruby}}==
<ruby>for i in 1..10 do
print i
break if i == 10
print ", "
end
puts</ruby>
 
=={{header|Scheme}}==
Anonymous user