Problem with brackets?

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

Problem with brackets?

ResponSyS
Hi everyone,

I encountered a error while executing a little program I wrote.
When I launch my file using GST, it displays:
02.Problem2.st:40: parse error, expected ']'

Here are the matching lines (
35> 1 to: 9 do:
36> [:i |
37> 1 to: 9 do:
38> [ :y |
39> (nBangArray at: i = (y printString)) ifTrue:
40>         [(nBangArray at: i) :=  y.].
41> ].
42> ].

I definitely don't where my mistake comes from. Can anyone help me?
Reply | Threaded
Open this post in threaded view
|

Re: Problem with brackets?

Ladislav Marek
Hi,

(nBangArray at: i) :=  y

is not correct syntax, I think you mean:

nBangArray at: i put: y

On Sat, Oct 22, 2011 at 16:26, Phen0m <[hidden email]> wrote:

> Hi everyone,
>
> I encountered a error while executing a little program I wrote.
> When I launch my file using GST, it displays:
> /02.Problem2.st:40: parse error, expected ']'/
>
> Here are the matching lines (
> 35> /1 to: 9 do:/
> 36>     /[:i |/
> 37>     /1 to: 9 do:/
> 38>             /[ :y |/
> 39>             /(nBangArray at: i = (y printString)) ifTrue:/
> 40>             /       [(nBangArray at: i) :=  y.]./
> 41>             /]./
> 42>     /]./
>
> I definitely don't where my mistake comes from. Can anyone help me?
>
> -----
> Il est encore temps d'ouvrir les yeux: http://www.reopen911.info/ | http://twitter.com/Phen0m77/ | http://blog.gamekult.com/blog/phen0m/ |
> Opera + DuckDuckGo = Smartest Browsing!
> --
> View this message in context: http://forum.world.st/Problem-with-brackets-tp3928272p3928272.html
> Sent from the Gnu mailing list archive at Nabble.com.
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/help-smalltalk
>

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Problem with brackets?

ResponSyS
Thanks for your reply!

That was exactly this. My syntax still is not that correct, but I'm practicing.

Ladislav Marek wrote
Hi,

(nBangArray at: i) :=  y

is not correct syntax, I think you mean:

nBangArray at: i put: y

On Sat, Oct 22, 2011 at 16:26, Phen0m <[hidden email]> wrote:
> Hi everyone,
>
> I encountered a error while executing a little program I wrote.
> When I launch my file using GST, it displays:
> /02.Problem2.st:40: parse error, expected ']'/
>
> Here are the matching lines (
> 35> /1 to: 9 do:/
> 36>     /[:i |/
> 37>     /1 to: 9 do:/
> 38>             /[ :y |/
> 39>             /(nBangArray at: i = (y printString)) ifTrue:/
> 40>             /       [(nBangArray at: i) :=  y.]./
> 41>             /]./
> 42>     /]./
>
> I definitely don't where my mistake comes from. Can anyone help me?

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk