|
Re: More than 256 literals referenced.: msg#00132lang.smalltalk.squeak.beginners
Robert Stehwien a écrit : What is the source of the error produced by the following code? The limitation is per-method. Beware, message selectors count for 1 literal (except some special selectors) Also Class names or class variables consume 1 slot... There, you have (#OrderedCollection -> OrderedCollection), #new, #add, #->, #as: (#Dictionary -> Dictionary)... There are other limitations, like number of argument per message, number of temporary variables per method, number of instance variables per class, length of blocks in an optimized ifTrue: [] ifFalse [] or [] whileTrue: [] or to:do:[] construct... This is based on the assumption that a Smalltalk method SHOULD be small. You can for example write as a workaround table := Dictionary new. #( #(#value 2) #(#cost 3) #(#etc 0.1) ) do: [:pair | table at: pair first put: pair last]. Nicolas
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: More than 256 literals referenced., Bert Freudenberg |
|---|---|
| Next by Date: | Re: More than 256 literals referenced., Conrad Taylor |
| Previous by Thread: | Re: More than 256 literals referenced., Robert Stehwien |
| Next by Thread: | Re: More than 256 literals referenced., Conrad Taylor |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |