Author: bernhard
Date: Wed Nov  2 14:24:28 2005
New Revision: 9730

Modified:
   trunk/examples/streams/Bytes.imc
   trunk/examples/streams/Combiner.imc
   trunk/examples/streams/Coroutine.imc
   trunk/examples/streams/FileLines.imc
   trunk/examples/streams/Filter.imc
   trunk/examples/streams/Include.imc
   trunk/examples/streams/Lines.imc
   trunk/examples/streams/ParrotIO.imc
   trunk/examples/streams/SubCounter.imc
   trunk/examples/streams/SubHello.imc
   trunk/examples/streams/Writer.imc
Log:
Get rid of deprecated 'newsub' in examples/streams


Modified: trunk/examples/streams/Bytes.imc
==============================================================================
--- trunk/examples/streams/Bytes.imc    (original)
+++ trunk/examples/streams/Bytes.imc    Wed Nov  2 14:24:28 2005
@@ -13,7 +13,6 @@ This example shows the usage of C<Stream
 
 .sub _main :main
     .local pmc stream
-    .local pmc temp
 
     load_bytecode "library/Stream/Sub.imc"
     load_bytecode "library/Stream/Replay.imc"
@@ -21,7 +20,7 @@ This example shows the usage of C<Stream
     find_type $I0, "Stream::Sub"
     new $P0, $I0
     # set the stream's source sub
-    newsub $P1, .Sub, _hello
+    .const .Sub temp = "_hello"
     assign $P0, $P1
 
     find_type $I0,"Stream::Replay"

Modified: trunk/examples/streams/Combiner.imc
==============================================================================
--- trunk/examples/streams/Combiner.imc (original)
+++ trunk/examples/streams/Combiner.imc Wed Nov  2 14:24:28 2005
@@ -28,7 +28,6 @@ Creates the 3 Stream objects and dumps t
     .local pmc counter
     .local pmc text
     .local pmc combined
-    .local pmc temp
 
     load_bytecode "library/Stream/Base.imc"
     load_bytecode "library/Stream/Combiner.imc"
@@ -37,14 +36,14 @@ Creates the 3 Stream objects and dumps t
     # create the counter stream
     find_type $I0, "Stream::Sub"
     new counter, $I0
-    newsub temp, .Sub, _counter
+    .const .Sub temp = "_counter"
     assign counter, temp
     
     # create the text stream
     find_type $I0, "Stream::Sub"
     new text, $I0
     # set its source
-    newsub temp, .Sub, _text
+    .const .Sub temp = "_text"
     assign text, temp
 
     # create a combiner stream
@@ -55,7 +54,7 @@ Creates the 3 Stream objects and dumps t
     assign combined, text
     
     # specify our own combiner sub
-    newsub temp, .Sub, _combiner
+    .const .Sub temp = "_combiner"
     combined."combiner"( temp )
     
     # dump the combined stream

Modified: trunk/examples/streams/Coroutine.imc
==============================================================================
--- trunk/examples/streams/Coroutine.imc        (original)
+++ trunk/examples/streams/Coroutine.imc        Wed Nov  2 14:24:28 2005
@@ -32,7 +32,8 @@ Creates a coroutine stream and dumps it.
     new stream, $I0
 
     # set the stream's source coroutine
-    newsub temp, .Coroutine, _coro
+    # A .Sub is a coroutine when there is a yield?
+    .const .Sub temp = "_coro"
     assign stream, temp
     #stream."source"( temp )
     

Modified: trunk/examples/streams/FileLines.imc
==============================================================================
--- trunk/examples/streams/FileLines.imc        (original)
+++ trunk/examples/streams/FileLines.imc        Wed Nov  2 14:24:28 2005
@@ -24,7 +24,6 @@ stream for it. Then it combines the stre
     .local pmc lines
     .local pmc counter
     .local pmc combiner
-    .local pmc temp
     .local string name
 
     # get the name of the file to open
@@ -52,7 +51,7 @@ NO_NAME:
     # endless counter
     find_type $I0, "Stream::Sub"
     new counter, $I0
-    newsub temp, .Sub, _counter
+    .const .Sub temp = "_counter"
     assign counter, temp
 
     # combine the counter and the file's lines

Modified: trunk/examples/streams/Filter.imc
==============================================================================
--- trunk/examples/streams/Filter.imc   (original)
+++ trunk/examples/streams/Filter.imc   Wed Nov  2 14:24:28 2005
@@ -20,7 +20,6 @@ Creates a counter stream that generates 
 .sub _main
     .local pmc stream
     .local pmc filter
-    .local pmc temp
 
     load_bytecode "library/Stream/Sub.imc"
     load_bytecode "library/Stream/Filter.imc"
@@ -29,7 +28,7 @@ Creates a counter stream that generates 
     find_type $I0, "Stream::Sub"
     new stream, $I0
     # assign its source
-    newsub temp, .Sub, _counter
+    .const .Sub temp = "_counter"
     assign stream, temp
 
     # create the filter stream
@@ -38,7 +37,7 @@ Creates a counter stream that generates 
     # assign its source
     assign filter, stream
     # set the filter sub
-    newsub temp, .Sub, _filter
+    .const .Sub temp = "_filter"
     filter."filter"( temp )
     
     # dump the stream

Modified: trunk/examples/streams/Include.imc
==============================================================================
--- trunk/examples/streams/Include.imc  (original)
+++ trunk/examples/streams/Include.imc  Wed Nov  2 14:24:28 2005
@@ -14,7 +14,6 @@ Creates a counter stream and dumps it.
 
 .sub _main
     .local pmc stream
-    .local pmc temp
 
     load_bytecode "library/Stream/Sub.imc"
     
@@ -22,13 +21,12 @@ Creates a counter stream and dumps it.
     new stream, $I0
 
     # set the stream's source sub
-    newsub temp, .Sub, _counter
+    .const .Sub temp = "_counter"
     assign stream, temp
     
     # dump the stream
     stream."dump"()
     
-    end
 .end
 
 =item _counter
@@ -56,12 +54,11 @@ LOOP:
     # include another stream after '4'
     if i != 4 goto SKIP
     .local pmc temp
-    .local pmc func
     
     find_type $I0, "Stream::Sub"
     new temp, $I0
 
-    newsub func, .Sub, _included
+    .const .Sub func = "_included"
     assign temp, func
     
     # include it
@@ -90,7 +87,7 @@ writes "world".
     # create another stream
     find_type $I0, "Stream::Sub"
     new temp, $I0
-    newsub func, .Sub, _counter2
+    .const .Sub func = "_counter2"
     assign temp, func
     
     # include it

Modified: trunk/examples/streams/Lines.imc
==============================================================================
--- trunk/examples/streams/Lines.imc    (original)
+++ trunk/examples/streams/Lines.imc    Wed Nov  2 14:24:28 2005
@@ -15,7 +15,6 @@ Creates a stream and pipes it through a 
 .sub _main
     .local pmc stream
     .local pmc lines
-    .local pmc temp
 
     load_bytecode "library/Stream/Sub.imc"
     load_bytecode "library/Stream/Lines.imc"
@@ -24,7 +23,7 @@ Creates a stream and pipes it through a 
     find_type $I0, "Stream::Sub"
     new stream, $I0
     # set the source
-    newsub temp, .Sub, _text
+    .const .Sub temp = "_text"
     assign stream, temp
 
     # create a lines stream

Modified: trunk/examples/streams/ParrotIO.imc
==============================================================================
--- trunk/examples/streams/ParrotIO.imc (original)
+++ trunk/examples/streams/ParrotIO.imc Wed Nov  2 14:24:28 2005
@@ -18,7 +18,6 @@ PMC to the stream with the C<assign> op.
 
 .sub _main :main
     .local pmc stream
-    .local pmc temp
 
     load_bytecode "library/Stream/ParrotIO.imc"
 

Modified: trunk/examples/streams/SubCounter.imc
==============================================================================
--- trunk/examples/streams/SubCounter.imc       (original)
+++ trunk/examples/streams/SubCounter.imc       Wed Nov  2 14:24:28 2005
@@ -14,7 +14,6 @@ Creates a C<Stream::Sub> and dumps it.
 
 .sub _main
     .local pmc stream
-    .local pmc temp
 
     load_bytecode "library/Stream/Base.imc"
     load_bytecode "library/Stream/Sub.imc"
@@ -23,7 +22,7 @@ Creates a C<Stream::Sub> and dumps it.
     new stream, $I0
 
     # set the stream's source sub
-    newsub temp, .Sub, _counter
+    .const .Sub temp = "_counter"
     assign stream, temp
     
     # dump the stream

Modified: trunk/examples/streams/SubHello.imc
==============================================================================
--- trunk/examples/streams/SubHello.imc (original)
+++ trunk/examples/streams/SubHello.imc Wed Nov  2 14:24:28 2005
@@ -14,7 +14,6 @@ Creates a C<Stream::Sub> and dumps it.
 
 .sub _main :main
     .local pmc stream
-    .local pmc temp
 
     load_bytecode "library/Stream/Sub.imc"
 
@@ -22,7 +21,7 @@ Creates a C<Stream::Sub> and dumps it.
     new stream, $I0
 
     # set the stream's source sub
-    newsub temp, .Sub, _hello
+    .const .Sub temp = "_hello"
     assign stream, temp
 
     # dump the stream

Modified: trunk/examples/streams/Writer.imc
==============================================================================
--- trunk/examples/streams/Writer.imc   (original)
+++ trunk/examples/streams/Writer.imc   Wed Nov  2 14:24:28 2005
@@ -14,7 +14,6 @@ Creates a C<Stream::Writer> and writes t
 
 .sub _main :main
     .local pmc stream
-    .local pmc temp
 
     load_bytecode "library/Stream/Writer.imc"
 
@@ -22,7 +21,7 @@ Creates a C<Stream::Writer> and writes t
     new stream, $I0
 
     # set the stream's source sub
-    newsub temp, .Sub, _reader
+    .const .Sub temp = "_reader"
     assign stream, temp
 
     print "main start\n"

Reply via email to