Thanks, but I had lots of help from lots of other smart folks.
···
At 4:32 AM +0900 7/18/02, Ned Konz wrote:
On Wednesday 17 July 2002 10:48 am, Christopher Browne wrote:
I seem to recall Objective C having a pretty nice approach to it,
too. (Somehow your name tickles some memories concerning ObjC…
You didn’t have some involvement with it, did you?)
Ruby with Objective-C’s message syntax? Now that’s something I could
really get behind… we could change the block syntax from {} to
while we’re at it, get rid of control structures in favor of methods
like ifTrue:ifFalse:, build a class browser or two, and we’d have a
great little language
Seriously, though, I’m curious - how did you end up at Ruby instead
of, say, Squeak? Clearly not for syntax reasons. I enjoy developing
in Ruby, Smalltalk, and Objective-C about equally (they all share the
One True Object Model, after all), but I sure do miss keyword
selectors in Ruby…
foo("this is a really long string. in fact, it is so long "
“that I have to wrap onto multiple lines.”)
Paul
···
On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote:
compile time string concatenation, “hello” “world” => “helloworld”
I know that some other popular languages like to do that,
but I think it would be better to leave it as two arguments.
After all, someone wrote those two literals separately on purpose.
Wouldn’t this add a significant amount of ambiguity and confusion? what if a
is a function that takes two arguments? what if the second is optional? etc
etc. In a language like ruby this would be a surprise, at least to me. It
also implies that there is currying going on when there isn’t, at least to
users of things like ml and haskell (though if there was, it might mitigate the
confusion - and be less and less like ruby).
-kyle
···
On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote:
obj.method a, b, c {|i| xyz}
vs
obj.method a b c {|i| xyz}
In message “Re: Syntax “surprise”” on 02/07/24, Mike Hall mghall@enteract.com writes:
I noticed this in the 1.6.7 TODO file:
compile time string concatenation, “hello” “world” => “helloworld”
You already have this feature (note: item with “-” is done). But I
admit I shouldn’t have. It is source of confusion rather than
usefulness. The far future Ruby will not have this feature, maybe.
Ruby with Objective-C’s message syntax? Now that’s something I could
really get behind… we could change the block syntax from {} to
while we’re at it, get rid of control structures in favor of methods
like ifTrue:ifFalse:, build a class browser or two, and we’d have a
great little language
While we’re picking syntactic nits, how about replacing begin…end with
{…} throughout? I rely on vim parentheses matching heavily and
begin–end removes this indispensible cruth.
Seriously, though, I’m curious - how did you end up at Ruby instead
of, say, Squeak? Clearly not for syntax reasons. I enjoy developing
in Ruby, Smalltalk, and Objective-C about equally (they all share the
One True Object Model, after all), but I sure do miss keyword
selectors in Ruby…
I wouldn’t say I’ve “ended up” with any particular tool, any more
than a carpenter “ends up” with a particular saw. I keep lots of
tools around and choose the right one for the job.
See http://virtualschool.edu/ile/tut/Pages/Background/HistoryPage for
why I picked ruby for the interactive learning environment project.
The biggest single reason was its #{…} string escape sequence,
which was unobtrusive and understandable even to nonprogrammers.
Mainly dropped python for this very reason. See http://virtualschool.edujwaa/demo/JwaaMLS for the nonsense I had to
go through to do something similar in java.
Please pardon the typos; they are fixed in the next release.
Thanks, but I had lots of help from lots of other smart folks.
That’s the way languages are designed. You smart people are helping
me now. Brad, I bought your book. It is my greatest astonishment for
years that I found you here. Thanks.
Ruby with Objective-C’s message syntax? Now that’s something I could
really get behind… we could change the block syntax from {} to
while we’re at it, get rid of control structures in favor of methods
like ifTrue:ifFalse:, build a class browser or two, and we’d have a
great little language
A few postings elsewhere have given examples of getting something that’s
similar to Objective-C’s (and SmallTalks) message syntax. Like a few other
people here, I think that naming message parameters can improve readability.
I wonder if it would at all be worth considering a little syntactic sugar
for this?
obj.my_method( :x => 10, :y => 20, :z => 30 )
sweetened to:
obj.my_method( x: 10, y: 20, z: 30 )
where the ‘:’ at the end of a parameter var really treats the var name as a
symbol and behaves as though it’s followed by a ‘=>’.
Look neat to me. What does anybody else think?
I think the blocks use {} because they are more familiar to many
programmers. After first looking at SmallTalk, I found the for blocks
strange until I got used to it. are used often for indexing in lots of
other languages.
Hey, wait a minute…are you trying to turn Ruby into SmallTalk? :o)
On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote:
compile time string concatenation, “hello” “world” => “helloworld”
I know that some other popular languages like to do that,
but I think it would be better to leave it as two arguments.
After all, someone wrote those two literals separately on purpose.
The following is a common idiom:
foo("this is a really long string. in fact, it is so long "
“that I have to wrap onto multiple lines.”)
or
foo("this is short\
and so is this")
The string would include the newline.
Jim
Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“Anyone else picturing Wallace sitting in front of a Rube Goldburgesque
workstation, accidentally booting up Netscape and crying out, ‘It’s the
wrong browser, Grommit!’ ?” – Jim Evans in rec.humor.oracle.d
i agree. you can’t get rid of the commas. that would really confuse
things.
method1 arg1 arg2, arg3 method2 argA, argB argC
whats the method precedence? or is it list? i’d get lost quick. ever
tried programming in rebol. yuk!
on the other hand, i never quite got why blocks ended up on the outside
of the arguments. is it just for nice syntax? seems to me by putting
them on the outside we’ve limited ourselves to one block (though you can
get around this):
iterator_method (arg) {...block...} ?
vs.
iterator_method (arg, {...block...}, {...another block...})
of course hashes and blocks using the same deliminator is probably
partly to do with it too.
~transami
···
On Tue, 2002-07-23 at 15:09, Kyle Rawlins wrote:
On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote:
obj.method a, b, c {|i| xyz}
vs
obj.method a b c {|i| xyz}
Wouldn’t this add a significant amount of ambiguity and confusion? what if a
is a function that takes two arguments? what if the second is optional? etc
etc. In a language like ruby this would be a surprise, at least to me. It
also implies that there is currying going on when there isn’t, at least to
users of things like ml and haskell (though if there was, it might mitigate the
confusion - and be less and less like ruby).
While we’re picking syntactic nits, how about replacing begin…end with
{…} throughout? I rely on vim parentheses matching heavily and
begin–end removes this indispensible cruth.
–
Dossy Shiobara mail: dossy@panoptic.com
Panoptic Computer Network web: http://www.panoptic.com/
“He realized the fastest way to change is to laugh at your own
folly – then you can let go and quickly move on.” (p. 70)
I should be thanking you, matz. You’ve done a wonderful job with
Ruby. If there’s any way I can help out, let me know.
···
At 2:11 PM +0900 7/18/02, Yukihiro Matsumoto wrote:
That’s the way languages are designed. You smart people are helping
me now. Brad, I bought your book. It is my greatest astonishment for
years that I found you here. Thanks.
On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote:
compile time string concatenation, “hello” “world” => “helloworld”
I know that some other popular languages like to do that,
but I think it would be better to leave it as two arguments.
After all, someone wrote those two literals separately on purpose.
The following is a common idiom:
foo("this is a really long string. in fact, it is so long "
“that I have to wrap onto multiple lines.”)
or
foo("this is short\
and so is this")
The string would include the newline.
I don’t think that’s the case in either of these examples – only if
you do:
Wouldn’t this add a significant amount of ambiguity and confusion? what if a
is a function that takes two arguments? what if the second is optional?
Don’t we have the same problem now, with commas?
We “solve” it with parens to group the arguments
and to clearly specify who goes with what.
I don’t think it’s the same problem. If you’ve got:
obj.method a, b, c {|i| xyz}
and (say) b is a method call that takes one optional argument, there’s
no danger that c will be interpreted as that argument.
I suspect that a Ruby-like language without commas separating method
arguments would end up with an awful lot of parentheses instead. (We
do have/use them now, as you point out, but they’d also have to do
what commas now do.)
David
···
On Thu, 25 Jul 2002, Mike Hall wrote:
On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote:
While we’re picking syntactic nits, how about replacing
begin…end with {…} throughout? I rely on vim parentheses
matching heavily and begin–end removes this indispensible cruth.
While we’re picking syntactic nits, how about replacing begin…end with
{…} throughout? I rely on vim parentheses matching heavily and
begin–end removes this indispensible cruth.
Actually, that version is quite old. Just use the one that comes stock
with your Vim 6.1.
Copy it from the $VIMRUNTIME/macros directory into your
$VIMRUNTIME/plugin directory.
–
Dossy Shiobara mail: dossy@panoptic.com
Panoptic Computer Network web: http://www.panoptic.com/
“He realized the fastest way to change is to laugh at your own
folly – then you can let go and quickly move on.” (p. 70)