[VW 7.7 NC] Bad examples in WinProcess>>fork:arguments:

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

[VW 7.7 NC] Bad examples in WinProcess>>fork:arguments:

Alan Darlington
WinProcess>>fork:arguments: starts with

fork: aString arguments: anArray
    "Run the named command with the given list of arguments in an external process. Return the output of the command, or if there are errors, return the contents of stderr."
    "self new fork: 'echo' arguments: #('blah blah blah')"  "Unix only - on Windows, echo is a builtin, and must be run by forking a shell to execute it. See shOne:."
    "self new fork: 'ipconfig' arguments: #('/?')"   "Windows only"

Both examples need to start with "self class new" if anybody at Cincom is interested.

    Cheers,
    Alan


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW 7.7 NC] Bad examples in WinProcess>>fork:arguments:

Eliot Miranda-2


On Sun, Feb 7, 2010 at 3:05 PM, Alan Darlington <[hidden email]> wrote:
WinProcess>>fork:arguments: starts with

fork: aString arguments: anArray
    "Run the named command with the given list of arguments in an external process. Return the output of the command, or if there are errors, return the contents of stderr."
    "self new fork: 'echo' arguments: #('blah blah blah')"  "Unix only - on Windows, echo is a builtin, and must be run by forking a shell to execute it. See shOne:."
    "self new fork: 'ipconfig' arguments: #('/?')"   "Windows only"

Both examples need to start with "self class new" if anybody at Cincom is interested.

Actually no.  These are exectable comments and in the browser self is bound to the class object.  If you change these to "self class new" you'll end up sending new to the metaclass and will create a new class not a new instance.
 

    Cheers,
    Alan


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW 7.7 NC] Bad examples in WinProcess>>fork:arguments:

Steven Kelly
In reply to this post by Alan Darlington

One thing could however be changed: ipconfig is a bad example, because (at least on my Win XP SP3), its output has CR CR LF for line breaks (I’ve checked this without VW). The line breaks are mapped to CR CR by VW, giving double-spaced results. I spent a fair few minutes wading through the VW line end handling before realizing!

 

Steve

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Eliot Miranda
Sent: 08 February 2010 03:50
To: Alan Darlington
Cc: vwnc NC
Subject: Re: [vwnc] [VW 7.7 NC] Bad examples in WinProcess>>fork:arguments:

 

 

On Sun, Feb 7, 2010 at 3:05 PM, Alan Darlington <[hidden email]> wrote:

WinProcess>>fork:arguments: starts with

fork: aString arguments: anArray
    "Run the named command with the given list of arguments in an external process. Return the output of the command, or if there are errors, return the contents of stderr."
    "self new fork: 'echo' arguments: #('blah blah blah')"  "Unix only - on Windows, echo is a builtin, and must be run by forking a shell to execute it. See shOne:."
    "self new fork: 'ipconfig' arguments: #('/?')"   "Windows only"

Both examples need to start with "self class new" if anybody at Cincom is interested.

 

Actually no.  These are exectable comments and in the browser self is bound to the class object.  If you change these to "self class new" you'll end up sending new to the metaclass and will create a new class not a new instance.

 


    Cheers,
    Alan

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW 7.7 NC] Bad examples in WinProcess>>fork:arguments:

Alan Darlington
In reply to this post by Eliot Miranda-2
Hi, Eliot.  I ran into this method in a debugger while I was tracking down a change in WinProcess>>cshOne: from 7.6 to 7.7.

When I attempted to execute the sample code (
"self new fork: 'ipconfig' arguments: #('/?')") in the debugger window, I got "message not understood: new".  I added "class" and the example worked perfectly.

Perhaps these executable comments could be written in such a way that they are not context sensitive.  While this didn't bother me (I've been using Smalltalk for 25 years now and expect weird things :-), a newbie might be confused.

    Best wishes,
    Alan


From: Eliot Miranda <[hidden email]>
To: Alan Darlington <[hidden email]>
Cc: vwnc NC <[hidden email]>
Sent: Sun, February 7, 2010 5:49:36 PM
Subject: Re: [vwnc] [VW 7.7 NC] Bad examples in WinProcess>>fork:arguments:

On Sun, Feb 7, 2010 at 3:05 PM, Alan Darlington <[hidden email]> wrote:
WinProcess>>fork:arguments: starts with

fork: aString arguments: anArray
    "Run the named command with the given list of arguments in an external process. Return the output of the command, or if there are errors, return the contents of stderr."
    "self new fork: 'echo' arguments: #('blah blah blah')"  "Unix only - on Windows, echo is a builtin, and must be run by forking a shell to execute it. See shOne:."
    "self new fork: 'ipconfig' arguments: #('/?')"   "Windows only"

Both examples need to start with "self class new" if anybody at Cincom is interested.

Actually no.  These are exectable comments and in the browser self is bound to the class object.  If you change these to "self class new" you'll end up sending new to the metaclass and will create a new class not a new instance.
 

    Cheers,
    Alan

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc