comparison nworker.rhope @ 103:7428aa5d6ade

Compiler compiled by compiler sort of working
author Mike Pavone <pavone@retrodev.com>
date Wed, 11 Aug 2010 03:13:28 -0400
parents e73a93fb5de1
children 43cc42df26cc
comparison
equal deleted inserted replaced
102:2f6f0867fd68 103:7428aa5d6ade
1374 1374
1375 Compile Blueprint@NBlueprint[bp,backend,name:out] 1375 Compile Blueprint@NBlueprint[bp,backend,name:out]
1376 { 1376 {
1377 //Rhope identifiers can't start with spaces, so we can use identifiers that start with spaces for special functions 1377 //Rhope identifiers can't start with spaces, so we can use identifiers that start with spaces for special functions
1378 init name <- [" init "]Append[name] 1378 init name <- [" init "]Append[name]
1379 copy name <- [" copy "]Append[name] 1379 [("Array","Boxed Array","Worker")]Find[name]
1380 cleanup name <- [" cleanup "]Append[name] 1380 {
1381 [("internalarraynaked","internalarrayboxed","internalworker")]Index[~]
1382 {
1383 copy name <- [~]Append["copy"]
1384 cleanup name <- [~]Append["cleanup"]
1385 }
1386 }{
1387 copy name <- [" copy "]Append[name]
1388 cleanup name <- [" cleanup "]Append[name]
1389 }
1381 type <- [[[Fold["_Compile Blueprint Methods", Fold["_Compile Blueprint Fields", [backend]Create Type[name], [bp]Fields >>], [bp]Methods >>] 1390 type <- [[[Fold["_Compile Blueprint Methods", Fold["_Compile Blueprint Fields", [backend]Create Type[name], [bp]Fields >>], [bp]Methods >>]
1382 ]Init <<[init name] 1391 ]Init <<[init name]
1383 ]Copy <<[copy name] 1392 ]Copy <<[copy name]
1384 ]Cleanup <<[cleanup name] 1393 ]Cleanup <<[cleanup name]
1385 1394
1387 } 1396 }
1388 1397
1389 Compile Special@NBlueprint[bp,backend,name:out] 1398 Compile Special@NBlueprint[bp,backend,name:out]
1390 { 1399 {
1391 init name <- [" init "]Append[name] 1400 init name <- [" init "]Append[name]
1392 copy name <- [" copy "]Append[name] 1401 [("Array","Boxed Array","Worker")]Find[name]
1393 cleanup name <- [" cleanup "]Append[name] 1402 {
1394 got specials <- [bp]Make Special[ 1403 after copyclean <- Val[backend]
1395 [bp]Make Special[ 1404 }{
1396 [bp]Make Special[backend, init name, name, "Make Init"], 1405 copy name <- [" copy "]Append[name]
1397 copy name, name, "Make Copy"], 1406 cleanup name <- [" cleanup "]Append[name]
1398 cleanup name, name, "Make Cleanup"] 1407 after copyclean <- [bp]Make Special[
1399 out <- Fold[["Getters Setters"]Set Input[2, name], got specials, [bp]Fields >>] 1408 [bp]Make Special[backend, copy name, name, "Make Copy"],
1409 cleanup name, name, "Make Cleanup"]
1410 }
1411 out <- Fold[["Getters Setters"]Set Input[2, name], [bp]Make Special[after copyclean, init name, name, "Make Init"], [bp]Fields >>]
1400 } 1412 }
1401 1413
1402 Blueprint NProgram 1414 Blueprint NProgram
1403 { 1415 {
1404 Blueprints 1416 Blueprints