Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode <MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode <MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
probably does not exist on VW. Also the logic was the same for Number of statement.
On May 2, 2009, at 3:26 PM, Alexandre Bergel wrote:
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Yes, I saw this. A Smalltalk model must not assume that a compile method can be deduced from a FAMIXMethod.
Alexandre
On 2 May 2009, at 15:58, Stéphane Ducasse wrote:
probably does not exist on VW. Also the logic was the same for Number of statement.
On May 2, 2009, at 3:26 PM, Alexandre Bergel wrote:
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi Alex,
The reason for this implementation is that in FAMIX 2.1 we did not have a good abstraction for sourceAnchor. So, for Smalltalk it is implemented by looking the method up in the image, and for other languages we rely on the external parser to provide this information.
But indeed, now that we do have a nicer abstraction, we could delegate the computation of number of lines of code.
However, for other low level metrics, like number of statements we only can compute that for Smalltalk. So that is why all these metrics are guarded by an isSmalltalk condition. What's more we only compute these metrics lazily so if an external parser provides it we just go with those values.
Just a note: source should be called sourceText to not confuse it with other kinds of sources (like the source of a relationship).
Cheers, Doru
On 2 May 2009, at 16:01, Alexandre Bergel wrote:
Yes, I saw this. A Smalltalk model must not assume that a compile method can be deduced from a FAMIXMethod.
Alexandre
On 2 May 2009, at 15:58, Stéphane Ducasse wrote:
probably does not exist on VW. Also the logic was the same for Number of statement.
On May 2, 2009, at 3:26 PM, Alexandre Bergel wrote:
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Be rather willing to give than demanding to get."
On May 2, 2009, at 4:01 PM, Alexandre Bergel wrote:
Yes, I saw this. A Smalltalk model must not assume that a compile method can be deduced from a FAMIXMethod.
??? I imagine that you want to say that we should not use a compiledMethod to get information about a FAMIXMethod. so far we never had to do a VW case study in pharo so the assumption is still valid.
Stef
Alexandre
On 2 May 2009, at 15:58, Stéphane Ducasse wrote:
probably does not exist on VW. Also the logic was the same for Number of statement.
On May 2, 2009, at 3:26 PM, Alexandre Bergel wrote:
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
No no. I am writing a Monticello Importer. This means that the model is a Smalltalk model. And no compiled method may be associated to a FAMIXMethod since the code will not be loaded. However, a MCMethodDefinition may be associated, but I do not see a reason why it should.
Alexandre
On 2 May 2009, at 16:13, Stéphane Ducasse wrote:
On May 2, 2009, at 4:01 PM, Alexandre Bergel wrote:
Yes, I saw this. A Smalltalk model must not assume that a compile method can be deduced from a FAMIXMethod.
??? I imagine that you want to say that we should not use a compiledMethod to get information about a FAMIXMethod. so far we never had to do a VW case study in pharo so the assumption is still valid.
Stef
Alexandre
On 2 May 2009, at 15:58, Stéphane Ducasse wrote:
probably does not exist on VW. Also the logic was the same for Number of statement.
On May 2, 2009, at 3:26 PM, Alexandre Bergel wrote:
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self mooseModel isSmalltalk ifTrue: [| parser | parser := VisualWorksParseTreeMetricCalculator new. parser processMethod: self usingImporter: nil inModel: nil. parser numberOfLinesOfCode] ifFalse: [-1]] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function? How comes that this method is so closely related to Smalltalk ? I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number> <property: #LOC longName: 'Lines of code' description: 'The number of lines of code in a method'> ^self lookUpPropertyNamed: #LOC computedAs: [self source lineCount] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
FAMIXBehavioralEntity>>source ^ self sourceAnchor source -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
On May 2, 2009, at 4:27 PM, Alexandre Bergel wrote:
No no. I am writing a Monticello Importer. This means that the model is a Smalltalk model. And no compiled method may be associated to a FAMIXMethod since the code will not be loaded. However, a MCMethodDefinition may be associated, but I do not see a reason why it should.
I did one MSE exporter (but I loaded code so this is not the same). How will you compute instance variable and method invocation without compiling the code?
Moose was done with a certain requirement in mind so we do not claim that it will cover all and future requirements. So far it worked or we fixed it.
Stef
Alexandre
On 2 May 2009, at 16:13, Stéphane Ducasse wrote:
On May 2, 2009, at 4:01 PM, Alexandre Bergel wrote:
Yes, I saw this. A Smalltalk model must not assume that a compile method can be deduced from a FAMIXMethod.
??? I imagine that you want to say that we should not use a compiledMethod to get information about a FAMIXMethod. so far we never had to do a VW case study in pharo so the assumption is still valid.
Stef
Alexandre
On 2 May 2009, at 15:58, Stéphane Ducasse wrote:
probably does not exist on VW. Also the logic was the same for Number of statement.
On May 2, 2009, at 3:26 PM, Alexandre Bergel wrote:
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
what is lineCount?
Stef
On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote:
> Dear All, > > Computing the number of lines of code is realized through: > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > FAMIXBehavioralEntity>>numberOfLinesOfCode > > <MSEProperty: #LOC type: #Number> > <property: #LOC longName: 'Lines of code' description: > 'The number of lines of code in a method'> > ^self > lookUpPropertyNamed: #LOC > computedAs: > [self mooseModel isSmalltalk > ifTrue: > [| parser | > parser := VisualWorksParseTreeMetricCalculator new. > parser processMethod: self usingImporter: nil inModel: nil. > parser numberOfLinesOfCode] > ifFalse: [-1]] > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > How to compute the number of lines of code with a C function? > How comes that this method is so closely related to Smalltalk ? > I am tempted to replace this method with something like: > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > FAMIXBehavioralEntity>>numberOfLinesOfCode > > <MSEProperty: #LOC type: #Number> > <property: #LOC longName: 'Lines of code' description: > 'The number of lines of code in a method'> > ^self > lookUpPropertyNamed: #LOC > computedAs: > [self source lineCount] > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > Where source will be defined as: > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > FAMIXBehavioralEntity>>source > ^ self sourceAnchor source > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > Any comments before I proceed? > > Alexandre > > -- > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: > Alexandre Bergel http://www.bergel.eu > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > > > > > > _______________________________________________ > Moose-dev mailing list > Moose-dev@iam.unibe.ch > https://www.iam.unibe.ch/mailman/listinfo/moose-dev >
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
I am writing a Monticello Importer. This means that the model is a Smalltalk model. And no compiled method may be associated to a FAMIXMethod since the code will not be loaded. However, a MCMethodDefinition may be associated, but I do not see a reason why it should.
I did one MSE exporter (but I loaded code so this is not the same). How will you compute instance variable and method invocation without compiling the code?
Using the compiler or RB may be one solution. I will think about it.
Alexandre
Alexandre
On 2 May 2009, at 16:13, Stéphane Ducasse wrote:
On May 2, 2009, at 4:01 PM, Alexandre Bergel wrote:
Yes, I saw this. A Smalltalk model must not assume that a compile method can be deduced from a FAMIXMethod.
??? I imagine that you want to say that we should not use a compiledMethod to get information about a FAMIXMethod. so far we never had to do a VW case study in pharo so the assumption is still valid.
Stef
Alexandre
On 2 May 2009, at 15:58, Stéphane Ducasse wrote:
probably does not exist on VW. Also the logic was the same for Number of statement.
On May 2, 2009, at 3:26 PM, Alexandre Bergel wrote:
String>>lineCount "Answer the number of lines represented by the receiver, where every cr adds one line. 5/10/96 sw" ...
Alexandre
On 2 May 2009, at 14:37, Stéphane Ducasse wrote:
> what is lineCount? > > Stef > > On May 2, 2009, at 12:35 PM, Alexandre Bergel wrote: > >> Dear All, >> >> Computing the number of lines of code is realized through: >> >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> FAMIXBehavioralEntity>>numberOfLinesOfCode >> >> <MSEProperty: #LOC type: #Number> >> <property: #LOC longName: 'Lines of code' description: >> 'The number of lines of code in a method'> >> ^self >> lookUpPropertyNamed: #LOC >> computedAs: >> [self mooseModel isSmalltalk >> ifTrue: >> [| parser | >> parser := VisualWorksParseTreeMetricCalculator new. >> parser processMethod: self usingImporter: nil inModel: >> nil. >> parser numberOfLinesOfCode] >> ifFalse: [-1]] >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> >> How to compute the number of lines of code with a C function? >> How comes that this method is so closely related to Smalltalk ? >> I am tempted to replace this method with something like: >> >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> FAMIXBehavioralEntity>>numberOfLinesOfCode >> >> <MSEProperty: #LOC type: #Number> >> <property: #LOC longName: 'Lines of code' description: >> 'The number of lines of code in a method'> >> ^self >> lookUpPropertyNamed: #LOC >> computedAs: >> [self source lineCount] >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> >> Where source will be defined as: >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> FAMIXBehavioralEntity>>source >> ^ self sourceAnchor source >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> >> Any comments before I proceed? >> >> Alexandre >> >> -- >> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: >> Alexandre Bergel http://www.bergel.eu >> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. >> >> >> >> >> >> _______________________________________________ >> Moose-dev mailing list >> Moose-dev@iam.unibe.ch >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> > > _______________________________________________ > Moose-dev mailing list > Moose-dev@iam.unibe.ch > https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
On May 2, 2009, at 4:56 PM, Alexandre Bergel wrote:
I am writing a Monticello Importer. This means that the model is a Smalltalk model. And no compiled method may be associated to a FAMIXMethod since the code will not be loaded. However, a MCMethodDefinition may be associated, but I do not see a reason why it should.
I did one MSE exporter (but I loaded code so this is not the same). How will you compute instance variable and method invocation without compiling the code?
Using the compiler or RB may be one solution. I will think about it.
so this is the same below
>>> [self mooseModel isSmalltalk >>> ifTrue: >>> [| parser | >>> parser := VisualWorksParseTreeMetricCalculator new. >>> parser processMethod: self usingImporter: nil inModel: >>> nil. >>> parser numberOfLinesOfCode]
Just that here you can avoid to use the parser by counting the cr or lf in the source code. So your remark was valid.
Stef