Squeak-specific syntax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Squeak-specific syntax

Mark Volkmann
I know that the syntax for literal and dynamic arrays is specific to  
Squeak.
Is the @ method in the Number class for creating Point objects  
specific to Squeak?
Is there any other syntax that is specific to Squeak?

---
Mark Volkmann





_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Squeak-specific syntax

Matthias Berth-2
Hi,

the @ method is not specific to Squeak. I guess it has been included
in the earliest versions of Smalltalk already.

I don't know about any other Squeak-specific syntax (apart from arrays).

If you're concerned about portability of your code to other Smalltalk
dialects then you might want to have a look at how the Seaside project
handles it. They have some tool that finds problematic code.

Cheers

Matthias

On Wed, Oct 29, 2008 at 10:43 PM, Mark Volkmann <[hidden email]> wrote:

> I know that the syntax for literal and dynamic arrays is specific to Squeak.
> Is the @ method in the Number class for creating Point objects specific to
> Squeak?
> Is there any other syntax that is specific to Squeak?
>
> ---
> Mark Volkmann
>
>
>
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Squeak-specific syntax

Nicolas Cellier-3
In reply to this post by Mark Volkmann
Mark Volkmann a écrit :

> I know that the syntax for literal and dynamic arrays is specific to
> Squeak.
> Is the @ method in the Number class for creating Point objects specific
> to Squeak?
> Is there any other syntax that is specific to Squeak?
>
> ---
> Mark Volkmann
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

No @ is not specific. it was already a binary message in Smalltalk-80
like + or * and should be found in every dialect.

Squeak has one major extension {1+1. 2*3.} for creating arrays
somehow equivalent to (Array with: 1+1 with: 2*3)

Plus the ability to use more than 2 binary characters to form a binary
message, see implementors of ==>

Plus the ability to use left arrow as an assignment, which was the only
assignment form in original st80, but that has been abandonned by
"modern" implementation.
Unfortunately, in ASCII the leftArrow code correspond to the ugly
underscore...


Squeak also has several documented and undocumented extensions about
interpreting literals.

Example of extensions: reading a Float in another base than 10:
2r0.1e10
Note that the exponent is interpreted in base 10, not 2

One ugly example: doubling the minus sign
-10r-2

One ANSI recommended but not smalltalkish: separating minus sign and
number with spaces:

- 2

note that it is interpreted differently in a literal array, one more
reason i do not like it:
#( - 2 )

Some bizarre literal symbols which are not really documented and likely
to fail in any other dialect:
##x
#12
#)
#.
#" i am a #x symbol "x
# x "me too"
#(#)# ) #()# :).
invent your own...

But in practice, i doubt anyone use such construct and write unportable
code (not guaranteed to survive in next Compiler implementation).

Nicolas

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Squeak-specific syntax

David Mitchell-10
In reply to this post by Matthias Berth-2
And, strictly speaking @ isn't really a syntax feature.

It is just a binary message send. If another Smalltalk didn't have it,
you could add it.

To add compile time arrays in other Smalltalks, you would have to
change the compiler (not always an option).

I think most Smalltalks have literal arrays, though.

On Wed, Oct 29, 2008 at 4:51 PM, Matthias Berth
<[hidden email]> wrote:

> Hi,
>
> the @ method is not specific to Squeak. I guess it has been included
> in the earliest versions of Smalltalk already.
>
> I don't know about any other Squeak-specific syntax (apart from arrays).
>
> If you're concerned about portability of your code to other Smalltalk
> dialects then you might want to have a look at how the Seaside project
> handles it. They have some tool that finds problematic code.
>
> Cheers
>
> Matthias
>
> On Wed, Oct 29, 2008 at 10:43 PM, Mark Volkmann <[hidden email]> wrote:
>> I know that the syntax for literal and dynamic arrays is specific to Squeak.
>> Is the @ method in the Number class for creating Point objects specific to
>> Squeak?
>> Is there any other syntax that is specific to Squeak?
>>
>> ---
>> Mark Volkmann
>>
>>
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Squeak-specific syntax

Tapple Gao
In reply to this post by Mark Volkmann
On Wed, Oct 29, 2008 at 04:43:49PM -0500, Mark Volkmann wrote:
> I know that the syntax for literal and dynamic arrays is specific to  
> Squeak.

The literal syntax #(1 2 3) is standard, I think, but not the
dynamic syntax {1. 2 .3}

> Is the @ method in the Number class for creating Point objects  
> specific to Squeak?

No; that's standard Smalltalk

> Is there any other syntax that is specific to Squeak?

FFI syntax is unique to squeak. It requires the FFI package to
be loaded to use it

Pragma syntax is unique to squeak, I believe. This is included
in 3.9 and later images

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Squeak-specific syntax

Lukas Renggli
> Pragma syntax is unique to squeak, I believe. This is included
> in 3.9 and later images

No. Squeak Pragma are compatible to the ones in VisualWorks, GemStone
and GNU Smalltalk.

I've compiled a list of syntactic/library differences (that matter to
Seaside) in my this years ESUG presentation:

   http://www.lukas-renggli.ch/blog/seaside-presentation-esug2008

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners