On 24 March 2011 20:58, Igor Stasenko siguctua@gmail.com wrote:
On 24 March 2011 20:56, Igor Stasenko siguctua@gmail.com wrote:
On 24 March 2011 20:47, Eliot Miranda eliot.miranda@gmail.com wrote:
You can always put a string literal inside literal array.. it will cost you just extra quotes and extra parsing effort..
Yes, but that would be a failure. If yu ever need a string literal I'd argue you're better off just using a string literal. But I think you could be OK. I think your hack could work for everything. I just want a proof.
it won't parse only following declarations:
#( int foo( int arg[] ) )
but we could modify compiler to treat [ and ] inside a literal array as #'[' and #']'
:)
oops, sorry, my bad.. it actually works...
#( int foo ( int arg[] ) ) ->
#(#int #foo #(#int #arg #'[' #']'))
#( int foo ( int arg[10] ) ) ->
#(#int #foo #(#int #arg #'[' 10 #']'))
There is a bug in parser, which fails to parse literal arrays if you don't put space between function name and its arguments.
#( int foo( int arg[] ) ) - fails
#( int foo ( int arg[] ) ) - works
which of course could be turned into just:
#( int foo( int * arg ) )
-- Best regards, Igor Stasenko AKA sig.
vm-dev@lists.squeakfoundation.org