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
Have with-output-to-string and friends take a body, not a thunk. #54
Comments
Better, have a general way to turn thunky procedures into body-bearing syntax, like Ruby's trick of putting a lambda immediately after the function call rather than before. |
Can you give an example of the trick in Ruby? |
In Ruby, instead of writing
which makes my_procedure look like syntax. You can prepend Note that in Smalltalk, the ancestor of Ruby, |
So, supposing an S-expression-like syntax, maybe an
Is short for this:
But I'm not sure how to add arguments to the lambda without making it messier in the common case of simple thunks. |
In Ruby and Smalltalk the |...| argument syntax is optional. We don't want to use actual vertical bars, but we could write {[x y] body}, where [x y] is optional. It depends on how much the Rhombus syntax actually changes Scheme. |
with-output-to-string
and friends take a body, not a thunk. The current form is better namedcall-with-output-to-string
, in the general pattern ofwith-x
being syntax andcall-with-x
being a procedure.Extracted from the old racket2 wiki. #33
More generally, is it good to keep the
with-x
andcall-with-x
forms?Tangentially discussed in #49
The text was updated successfully, but these errors were encountered: