|
Re: More than 256 literals referenced.: msg#00131lang.smalltalk.squeak.beginners
On Jul 23, 2007, at 22:47 , Robert Stehwien wrote: What is the source of the error produced by the following code? The limit is 256 literals per method. However, a literal array is still just one literal. So you can put all your data into one literal if you want: #(( value 2 cost -3 step 2 defense 3 combatMove 7 fullMove 14 carry 10 lift 20 death 20 unconscious 11 woundThreshold 4 recovery 05 mysticArmor 0 ) ( value 2 cost -3 step 2 defense 3 combatMove 7 fullMove 14 carry 10 lift 20 death 20 unconscious 11 woundThreshold 4 recovery 05 mysticArmor 0 ) ) Then just iterate over it (#do: for the outer array, #pairsDo: is handy for the inner) to construct your objects. Btw, you surely would like to make a class and not just use dictionaries ;) - Bert -
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Refactoring into Packages, Michael Gorsuch |
|---|---|
| Next by Date: | Re: More than 256 literals referenced., nicolas cellier |
| Previous by Thread: | More than 256 literals referenced., Robert Stehwien |
| Next by Thread: | Re: More than 256 literals referenced., nicolas cellier |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |