Fwd: [Pharo-project] Long method can not be compiled using #compile: aString

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

Fwd: [Pharo-project] Long method can not be compiled using #compile: aString

Eliot Miranda-2


---------- Forwarded message ----------
From: Eliot Miranda <[hidden email]>
Date: Wed, Dec 23, 2009 at 10:11 AM
Subject: Re: [Pharo-project] Long method can not be compiled using #compile: aString
To: [hidden email]
Cc: The general-purpose Squeak developers list <[hidden email]>


This results in an MNU instead of a warning about too many literals because Encoder>>notify: does not report notifications if there is no requestor (if compilation is non-interactive).  A fix would be to integrate with Colin's compiler error changes, e.g. by having Encoder hold onto its parser and defer to Parser>>notify:.  In the interim an adequate fix is

!Encoder methodsFor: 'error handling' stamp: 'eem 12/22/2009 11:57'!
notify: string
"Put a separate notifier on top of the requestor's window"
| req |
requestor == nil
ifTrue:
[super notify: string]
ifFalse: 
[req := requestor.
self release.
req notify: string].
^false! !

With this fix a notifier opens stating:
"More than 256 literals referenced. 
 You must split or otherwise simplify this method.
 The 257th literal is: 397

 Select Proceed to continue, or close this window to cancel the operation."

Find file-in attached.


2009/12/21 Bart Gauquie <[hidden email]>

Hi,  


Then for instance following fails if I evaluate it in a workspace:

MorphicReplayDemoTest compile: 
'testMethod
self addMMEFrom: 1054@512 to: 1037@504.
self addMMEFrom: 1037@504 to: 979@482.
self addMMEFrom: 979@482 to: 905@464.
self addMMEFrom: 905@464 to: 823@462.
self addMMEFrom: 823@462 to: 745@482.
self addMMEFrom: 745@482 to: 685@520.
self addMMEFrom: 685@520 to: 651@559.

self addMMEFrom: 651@559 to: 643@579.
self addMMEFrom: 643@579 to: 653@579.
self addMMEFrom: 653@579 to: 675@564.
self addMMEFrom: 675@564 to: 810@452.
self addMMEFrom: 810@452 to: 923@353.
self addMMEFrom: 923@353 to: 1005@287.
self addMMEFrom: 1005@287 to: 1052@257.
self addMMEFrom: 1052@257 to: 1061@252.
self addMMEFrom: 1061@252 to: 1059@259.
self addMMEFrom: 1059@259 to: 998@314.
self addMMEFrom: 998@314 to: 898@414.
self addMMEFrom: 898@414 to: 827@502.
self addMMEFrom: 827@502 to: 789@570.
self addMMEFrom: 789@570 to: 792@610.
self addMMEFrom: 792@610 to: 839@630.
self addMMEFrom: 839@630 to: 929@620.
self addMMEFrom: 929@620 to: 1039@579.
self addMMEFrom: 1039@579 to: 1086@549.
self addMMEFrom: 1086@549 to: 1158@447.
self addMMEFrom: 1158@447 to: 1147@379.
self addMMEFrom: 1147@379 to: 1066@377.
self addMMEFrom: 1066@377 to: 930@416.
self addMMEFrom: 930@416 to: 864@446.
self addMMEFrom: 864@446 to: 734@530.
self addMMEFrom: 734@530 to: 714@548.
self addMMEFrom: 714@548 to: 734@546.
self addMMEFrom: 734@546 to: 815@515.
self addMMEFrom: 815@515 to: 875@491.
self addMMEFrom: 875@491 to: 1065@407.
self addMMEFrom: 1065@407 to: 1128@361.
self addMMEFrom: 1128@361 to: 1142@343.
self addMMEFrom: 1142@343 to: 1112@340.
self addMMEFrom: 1112@340 to: 1064@349.
self addMMEFrom: 1064@349 to: 864@416.
self addMMEFrom: 864@416 to: 757@471.
self addMMEFrom: 757@471 to: 705@511.
self addMMEFrom: 705@511 to: 701@524.
self addMMEFrom: 701@524 to: 743@528.
self addMMEFrom: 743@528 to: 845@509.
self addMMEFrom: 845@509 to: 914@493.
self addMMEFrom: 914@493 to: 1101@446.
self addMMEFrom: 1101@446 to: 1154@427.
self addMMEFrom: 1154@427 to: 1163@423.
self addMMEFrom: 1163@423 to: 1156@422.
self addMMEFrom: 1156@422 to: 1129@424.
self addMMEFrom: 1129@424 to: 923@449.
self addMMEFrom: 923@449 to: 785@479.
self addMMEFrom: 785@479 to: 689@503.
self addMMEFrom: 689@503 to: 651@512.
self addMMEFrom: 651@512 to: 650@512.
self addMMEFrom: 650@512 to: 672@508.
self addMMEFrom: 672@508 to: 773@492.
self addMMEFrom: 773@492 to: 916@486.
self addMMEFrom: 916@486 to: 1066@494.
self addMMEFrom: 1066@494 to: 1175@508.
self addMMEFrom: 1175@508 to: 1229@514.
self addMMEFrom: 1229@514 to: 1232@514.
self addMMEFrom: 1232@514 to: 1142@492.
self addMMEFrom: 1142@492 to: 986@483.
self addMMEFrom: 986@483 to: 810@498.
self addMMEFrom: 810@498 to: 678@519.
self addMMEFrom: 678@519 to: 637@523.
self addMMEFrom: 637@523 to: 606@502.
self addMMEFrom: 606@502 to: 659@442.
self addMMEFrom: 659@442 to: 769@365.
self addMMEFrom: 769@365 to: 911@316.
self addMMEFrom: 911@316 to: 1052@318.
self addMMEFrom: 1052@318 to: 1129@360.
self addMMEFrom: 1129@360 to: 1153@403.
self addMMEFrom: 1153@403 to: 1127@443.
self addMMEFrom: 1127@443 to: 1015@491.
self addMMEFrom: 1015@491 to: 850@536.
self addMMEFrom: 850@536 to: 697@571.
self addMMEFrom: 697@571 to: 642@578.
self addMMEFrom: 642@578 to: 571@545.
self addMMEFrom: 571@545 to: 604@485.
self addMMEFrom: 604@485 to: 701@419.
self addMMEFrom: 701@419 to: 843@383.
self addMMEFrom: 843@383 to: 919@383.
self addMMEFrom: 919@383 to: 1095@425.
self addMMEFrom: 1095@425 to: 1126@443.
self addMMEFrom: 1126@443 to: 1102@449.
self addMMEFrom: 1102@449 to: 984@468.
self addMMEFrom: 984@468 to: 829@509.
self addMMEFrom: 829@509 to: 703@547.
self addMMEFrom: 703@547 to: 637@555.
self addMMEFrom: 637@555 to: 633@531.
self addMMEFrom: 633@531 to: 694@468.
self addMMEFrom: 694@468 to: 809@407.
self addMMEFrom: 809@407 to: 946@380.
self addMMEFrom: 946@380 to: 1011@378.
self addMMEFrom: 1011@378 to: 1119@393.
self addMMEFrom: 1119@393 to: 1110@393.
self addMMEFrom: 1110@393 to: 1010@388.
self addMMEFrom: 1010@388 to: 859@402.
self addMMEFrom: 859@402 to: 727@433.
self addMMEFrom: 727@433 to: 665@454.
self addMMEFrom: 665@454 to: 663@461.
self addMMEFrom: 663@461 to: 683@469.
self addMMEFrom: 683@469 to: 837@492.
self addMMEFrom: 837@492 to: 989@495.
self addMMEFrom: 989@495 to: 1103@476.
self addMMEFrom: 1103@476 to: 1153@433.
self addMMEFrom: 1153@433 to: 1163@404.
self addMMEFrom: 1163@404 to: 1147@307.
self addMMEFrom: 1147@307 to: 1086@294.
self addMMEFrom: 1086@294 to: 995@324.
self addMMEFrom: 995@324 to: 935@357.
self addMMEFrom: 935@357 to: 922@366.
self addMMEFrom: 922@366 to: 925@370.
self addMMEFrom: 925@370 to: 941@379.
self addMMEFrom: 941@379 to: 974@389.
self addMMEFrom: 974@389 to: 1010@399.
self addMMEFrom: 1010@399 to: 1036@408.
self addMMEFrom: 1036@408 to: 1052@414.
self addMMEFrom: 1052@414 to: 1056@416.
self addMMEFrom: 1056@416 to: 1061@418.
self addMMEFrom: 1061@418 to: 1068@419.
self addMMEFrom: 1068@419 to: 1078@418.
self addMMEFrom: 1078@418 to: 1086@414.
self addMMEFrom: 1086@414 to: 1089@411.
self addMMEFrom: 1089@411 to: 1095@404.
self addMMEFrom: 1095@404 to: 1097@404.
self addMMEFrom: 1097@404 to: 1099@406.
self addMMEFrom: 1099@406 to: 1100@407.
self addMMEFrom: 1100@407 to: 1101@408.
self addMMEFrom: 1101@408 to: 1101@409.
self addMMEFrom: 1101@409 to: 1101@410.
self addMMEFrom: 1101@410 to: 1102@411.
self addMMEFrom: 1102@411 to: 1104@412.
self addMMEFrom: 1104@412 to: 1106@411.
self addMMEFrom: 1106@411 to: 1110@409.
self addMMEFrom: 1110@409 to: 1112@408.
self addMMEFrom: 1112@408 to: 1114@407.
self addMMEFrom: 1114@407 to: 1115@408.
self addMMEFrom: 1115@408 to: 1115@408.
self addMMEFrom: 1115@408 to: 1115@407.
MouseButtonEvent new.
MouseButtonEvent new.
self addMMEFrom: 1131@401 to: 1129@403.
self addMMEFrom: 1129@403 to: 1121@408.
self addMMEFrom: 1121@408 to: 1106@416.
self addMMEFrom: 1106@416 to: 1084@426.
self addMMEFrom: 1084@426 to: 1051@443.
self addMMEFrom: 1051@443 to: 1019@470.
self addMMEFrom: 1019@470 to: 995@504.
self addMMEFrom: 995@504 to: 981@546.
self addMMEFrom: 981@546 to: 980@592.
self addMMEFrom: 980@592 to: 990@634.
self addMMEFrom: 990@634 to: 1012@665.
self addMMEFrom: 1012@665 to: 1043@680.
self addMMEFrom: 1043@680 to: 1076@677.
self addMMEFrom: 1076@677 to: 1132@658.
self addMMEFrom: 1132@658 to: 1189@626.
self addMMEFrom: 1189@626 to: 1205@606.
self addMMEFrom: 1205@606 to: 1222@543.
self addMMEFrom: 1222@543 to: 1219@504.
self addMMEFrom: 1219@504 to: 1207@464.
self addMMEFrom: 1207@464 to: 1190@425.
self addMMEFrom: 1190@425 to: 1180@409.
self addMMEFrom: 1180@409 to: 1140@387.
self addMMEFrom: 1140@387 to: 1092@397.
self addMMEFrom: 1092@397 to: 1044@424.
self addMMEFrom: 1044@424 to: 1004@464.
self addMMEFrom: 1004@464 to: 977@513.
self addMMEFrom: 977@513 to: 965@565.
self addMMEFrom: 965@565 to: 965@614.
self addMMEFrom: 965@614 to: 977@656.
self addMMEFrom: 977@656 to: 1001@689.
self addMMEFrom: 1001@689 to: 1035@709.
self addMMEFrom: 1035@709 to: 1067@714.
self addMMEFrom: 1067@714 to: 1094@710.
self addMMEFrom: 1094@710 to: 1219@673.
self addMMEFrom: 1219@673 to: 1254@635.
self addMMEFrom: 1254@635 to: 1269@594.
self addMMEFrom: 1269@594 to: 1277@552.
self addMMEFrom: 1277@552 to: 1277@530.
self addMMEFrom: 1277@530 to: 1251@459.
self addMMEFrom: 1251@459 to: 1215@418.
self addMMEFrom: 1215@418 to: 1180@389.
self addMMEFrom: 1180@389 to: 1143@377.
self addMMEFrom: 1143@377 to: 1092@379.
self addMMEFrom: 1092@379 to: 1041@397.
self addMMEFrom: 1041@397 to: 1019@410.
self addMMEFrom: 1019@410 to: 972@460.
self addMMEFrom: 972@460 to: 955@499.
self addMMEFrom: 955@499 to: 951@541.
self addMMEFrom: 951@541 to: 954@580.
self addMMEFrom: 954@580 to: 960@597.
self addMMEFrom: 960@597 to: 991@639.
self addMMEFrom: 991@639 to: 1027@657.
self addMMEFrom: 1027@657 to: 1066@666.
self addMMEFrom: 1066@666 to: 1122@665.
self addMMEFrom: 1122@665 to: 1199@651.
self addMMEFrom: 1199@651 to: 1245@625.
self addMMEFrom: 1245@625 to: 1270@596.
self addMMEFrom: 1270@596 to: 1284@565.
self addMMEFrom: 1284@565 to: 1287@528.
self addMMEFrom: 1287@528 to: 1275@486.
self addMMEFrom: 1275@486 to: 1242@445.
self addMMEFrom: 1242@445 to: 1204@412.
self addMMEFrom: 1204@412 to: 1171@390.
self addMMEFrom: 1171@390 to: 1126@383.
self addMMEFrom: 1126@383 to: 1083@394.
self addMMEFrom: 1083@394 to: 1040@420.
self addMMEFrom: 1040@420 to: 1025@438.
self addMMEFrom: 1025@438 to: 996@506.
self addMMEFrom: 996@506 to: 992@555.
self addMMEFrom: 992@555 to: 999@596.
self addMMEFrom: 999@596 to: 1015@629.
self addMMEFrom: 1015@629 to: 1027@641.
self addMMEFrom: 1027@641 to: 1068@658.
self addMMEFrom: 1068@658 to: 1115@655.
self addMMEFrom: 1115@655 to: 1184@640.
self addMMEFrom: 1184@640 to: 1234@616.
self addMMEFrom: 1234@616 to: 1266@589.
self addMMEFrom: 1266@589 to: 1290@555.
self addMMEFrom: 1290@555 to: 1301@518.
self addMMEFrom: 1301@518 to: 1296@474.
self addMMEFrom: 1296@474 to: 1267@430.
self addMMEFrom: 1267@430 to: 1223@392.
self addMMEFrom: 1223@392 to: 1187@370.
self addMMEFrom: 1187@370 to: 1172@366.
self addMMEFrom: 1172@366 to: 1115@375.
self addMMEFrom: 1115@375 to: 1076@397.
self addMMEFrom: 1076@397 to: 1046@429.
self addMMEFrom: 1046@429 to: 1027@468.
self addMMEFrom: 1027@468 to: 1022@489.
self addMMEFrom: 1022@489 to: 1023@545.
self addMMEFrom: 1023@545 to: 1033@567.
self addMMEFrom: 1033@567 to: 1061@590.
self addMMEFrom: 1061@590 to: 1104@603.
self addMMEFrom: 1104@603 to: 1165@605.
self addMMEFrom: 1165@605 to: 1220@593.
self addMMEFrom: 1220@593 to: 1258@571.
self addMMEFrom: 1258@571 to: 1284@543.
self addMMEFrom: 1284@543 to: 1298@509.
self addMMEFrom: 1298@509 to: 1299@466.
self addMMEFrom: 1299@466 to: 1276@414.
self addMMEFrom: 1276@414 to: 1255@390.
self addMMEFrom: 1255@390 to: 1189@340.
self addMMEFrom: 1189@340 to: 1148@334.
self addMMEFrom: 1148@334 to: 1094@346.
self addMMEFrom: 1094@346 to: 1051@373.
self addMMEFrom: 1051@373 to: 1021@412.
self addMMEFrom: 1021@412 to: 1006@457.
self addMMEFrom: 1006@457 to: 1002@506.
self addMMEFrom: 1002@506 to: 1006@557.
self addMMEFrom: 1006@557 to: 1012@581.
self addMMEFrom: 1012@581 to: 1041@637.
self addMMEFrom: 1041@637 to: 1070@657.
self addMMEFrom: 1070@657 to: 1127@660.
self addMMEFrom: 1127@660 to: 1209@644.
self addMMEFrom: 1209@644 to: 1234@630.
self addMMEFrom: 1234@630 to: 1284@569.
self addMMEFrom: 1284@569 to: 1302@521.
self addMMEFrom: 1302@521 to: 1304@466.
self addMMEFrom: 1304@466 to: 1286@410.
self addMMEFrom: 1286@410 to: 1247@369.
self addMMEFrom: 1247@369 to: 1208@347.
self addMMEFrom: 1208@347 to: 1196@342.
self addMMEFrom: 1196@342 to: 1170@346.
self addMMEFrom: 1170@346 to: 1151@356.
self addMMEFrom: 1151@356 to: 1137@363.
self addMMEFrom: 1137@363 to: 1133@366.
self addMMEFrom: 1133@366 to: 1133@366.
self addMMEFrom: 1133@366 to: 1135@372.
self addMMEFrom: 1135@372 to: 1133@381.
self addMMEFrom: 1133@381 to: 1128@393.
self addMMEFrom: 1128@393 to: 1126@399.
self addMMEFrom: 1126@399 to: 1125@401.
self addMMEFrom: 1125@401 to: 1125@401.
self addMMEFrom: 1125@401 to: 1125@400.
self addMMEFrom: 1125@400 to: 1124@401.
self addMMEFrom: 1124@401 to: 1124@403.
self addMMEFrom: 1124@403 to: 1124@404.
self addMMEFrom: 1124@404 to: 1124@405.
self addMMEFrom: 1124@405 to: 1124@404.
MouseButtonEvent new.
MouseButtonEvent new.
'

These are autogenerated contents I want to export as a test case. The strange thing is that, if I manually create the testMethod using the system browser, and paste the content in it; it works fine.

Kind Regards,

Bart

2009/12/21 Eliot Miranda <[hidden email]>

Hi Bart,

    I still want to take a look at this specific case because the compiler should produce a proper error message, not an internal error.  So could you please package it up as a reproducible case, or email me the full string that fails?

TIA


2009/12/20 Bart Gauquie <[hidden email]>
Dear all,

I'm developing code which generates a method content, compiles it and adds it to an existing class. 
I compile the message using #compile: message:
for instance:

MorphicReplayDemoTest compile: '
testMethod
self addMMEFrom: 1054@512 to: 1037@504.
self addMMEFrom: 651@559 to: 643@579.
'.

This works fine. However if the contents of the method is too long; for instance: 
if the self addMMEFrom: 1054@512 to: 1037@504. is repeated around 250 times; I get following error (see stack below)

The strange thing is that if I manually add that method using the editor and paste it, it works just fine. I even tested up to 5000 lines of code; its slow, but its working.

Any ideas how to solve this?

Thanks,

Bart

I'm using Pharo 1.0 rc update: 10502; using Ubuntu 9.10, using vm pharo-vm-0.15.2f-linux.

THERE_BE_DRAGONS_HERE
MessageNotUnderstood: receiver of "<" is nil
20 December 2009 8:17:14 pm

VM: unix - i686 - linux-gnu - Pharo0.1 of 16 May 2008 [latest update: #10074]
Image: PharoCore1.0rc1 [Latest update: #10502]

 
[a sizeable chunk deleted]




Encoder-notify.st (532 bytes) Download Attachment