[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] [RFC] New Smalltalk syntax v2
From: |
Paolo Bonzini |
Subject: |
Re: [Help-smalltalk] [RFC] New Smalltalk syntax v2 |
Date: |
Fri, 16 Mar 2007 13:10:32 +0100 |
User-agent: |
Thunderbird 1.5.0.10 (Macintosh/20070221) |
> I did not see any discussion of the alternative I proposed, see the
> details here:
> http://www.nabble.com/Re%3A--RFC--Smalltalk-scripting-syntax-p9406679.html
Uh, I thought I had answered that.
I don't like it because, ironically, I like ''' very much.
But while you propose adding a useful syntax element, at the
same time you make it inaccessible to the methods themselves
(no, escaping is not a solution).
> Note also that this approach opens up the system for alternative
> syntaxes. Such as:
That's a property of ''' in general, not tied to your proposal.
With pragmas you could write a method like:
unsafeFastAdd: y
<cCode: '''
printf("unsafeFastAdd called\n");
// the following code may crash the VM
// if the arguments are not small integers
// no testing is done for performance reasons
// which is probably really not very wise in the long term.
// But if you can't crash it, you're not doing the driving. :-)
return int_to_st(st_to_int(x) + st_to_int(y));
}
''' safetyLevel: #mayCrashVM>
Paolo