OA,
Would it be possible to get a short status report on Dolphin 5.0 now that it is March? Don't let it keep you from the important work at hand, though. I wonder if one change will make it into this version: a compiler or parser implementation in Smalltalk instead of the one hidden away in the DLL. There was talk of this once. Since no one posted a Dolphin solution to :+=, I assume that it isn't possible in Dolphin, possibly due to lack of access to the compiler or parser. Thanks. Keith Alcock |
No, the D5 compiler is delivered in DolphinCR005.dll and is not suitable
for modification. Keith Alcock wrote: > > OA, > > Would it be possible to get a short status report on Dolphin 5.0 now > that it is March? Don't let it keep you from the important work at > hand, though. > > I wonder if one change will make it into this version: a compiler or > parser implementation in Smalltalk instead of the one hidden away in the > DLL. There was talk of this once. Since no one posted a Dolphin > solution to :+=, I assume that it isn't possible in Dolphin, possibly > due to lack of access to the compiler or parser. > > Thanks. > > Keith Alcock |
Keith Alcock <[hidden email]> wrote in message
news:[hidden email]... > No, the D5 compiler is delivered in DolphinCR005.dll and is not suitable > for modification. > > Keith Alcock wrote: ... > > > > I wonder if one change will make it into this version: a compiler or > > parser implementation in Smalltalk instead of the one hidden away in the > > DLL. There was talk of this once. Since no one posted a Dolphin > > solution to :+=, I assume that it isn't possible in Dolphin, possibly > > due to lack of access to the compiler or parser. While we don't have compiler source code in Dolphin Smalltalk (yet) I believe there is a parser included as part of the refactoring browser. There is reformatting code in D5, perhaps it could be extended to replace :+= with the desired code expansion. If that was not a suitable option perhaps one could hook into the compiler methods of CompilerLibrary to do the code swap there. I think this could be done by renaming the existing methods, then writing "wrapper" methods to call the original methods with the modified source. I think what you want to do could be done, but I am not sure extending the syntax is a good idea for most people. Chris |
Christopher, etc.,
One of the problems with having multiple Smalltalk parsers in the image is that they are likely to (and do!) parse different languages. There is a message somewhere in the newsgroup about a message being sent to the transcript when the refactoring browser parser cannot parse valid Dolphin code. In addition it is duplication of effort, both in writing and maintaining two versions. Last time I checked, the Dolphin compiler insists that binary operators have at most two characters. Other Smalltalks are more lenient and might allow :+= to be defined as an operator. So far my best solution is to define a numeric value holder class and then provide methods for += and -=. Normally I wouldn't do that, but it was a case of veryDescriptiveVariableName := veryDescriptiveVariableName + first part of lengthy equation. several more calculations. veryDescriptiveVariableName := veryDescriptiveVariableName + second part of lengthy equation. more calculations. etc. and I thought that += made it obvious that the value wasn't being reset, but being used to accumulate partial results. The statements also fit on single lines that way. Anyway, it worked for me. Keith Alcock Christopher J. Demers wrote: > > Keith Alcock <[hidden email]> wrote in message > news:[hidden email].. > > No, the D5 compiler is delivered in DolphinCR005.dll and is not suitable > > for modification. > > > > Keith Alcock wrote: > ... > > > > > > I wonder if one change will make it into this version: a compiler or > > > parser implementation in Smalltalk instead of the one hidden away in the > > > DLL. There was talk of this once. Since no one posted a Dolphin > > > solution to :+=, I assume that it isn't possible in Dolphin, possibly > > > due to lack of access to the compiler or parser. > > While we don't have compiler source code in Dolphin Smalltalk (yet) I > believe there is a parser included as part of the refactoring browser. > There is reformatting code in D5, perhaps it could be extended to replace > :+= with the desired code expansion. If that was not a suitable option > perhaps one could hook into the compiler methods of CompilerLibrary to do > the code swap there. I think this could be done by renaming the existing > methods, then writing "wrapper" methods to call the original methods with > the modified source. I think what you want to do could be done, but I am > not sure extending the syntax is a good idea for most people. > > Chris |
"Keith Alcock" <[hidden email]> wrote in message
news:[hidden email]... > ... > Last time I checked, the Dolphin compiler insists that binary operators have at most > two characters. Other Smalltalks are more lenient ... As far as I remember it is the other way around: Dolphin's compiler has always (?) allowed a binary selector to have more than 2 characters, whereas this is not true in some other Smalltalks, and in fact the RB-based parser does not like them either. I can't quite remember what the ANSI standard says on this issue, and I don't have my copy to hand. >...and might allow :+= to be defined > as an operator... The colon character is not really legal in a binary selector (though the Dolphin Compiler allows it as the first character so it would allow :+=), there being a clash with its use as the separator in keyword selectors. Regards Blair |
Blair,
Not that it matters much, but if I try to define some binary methods like :+= or +=& with D5, then messages like these show up on the transcript: Error 32 on line 1 of MyTest>>:+= -> 'expecting message pattern' Error 41 on line 1 of MyTest>>+=& -> 'variable name expected' The methods do seem to compile nevertheless--and even run! Maybe the messages come from some other parser (one for a different language) instead of from Dolphin. Keith Blair McGlashan wrote: > > "Keith Alcock" <[hidden email]> wrote in message > news:[hidden email].. > > ... > > Last time I checked, the Dolphin compiler insists that binary operators > have at most > > two characters. Other Smalltalks are more lenient ... > > As far as I remember it is the other way around: Dolphin's compiler has > always (?) allowed a binary selector to have more than 2 characters, whereas > this is not true in some other Smalltalks, and in fact the RB-based parser > does not like them either. I can't quite remember what the ANSI standard > says on this issue, and I don't have my copy to hand. > > >...and might allow :+= to be defined > > as an operator... > > The colon character is not really legal in a binary selector (though the > Dolphin Compiler allows it as the first character so it would allow :+=), > there being a clash with its use as the separator in keyword selectors. > > Regards > > Blair |
Keith Alcock <[hidden email]> wrote in message news:<[hidden email]>...
> Not that it matters much, but if I try to define some binary methods like :+= or > +=& with D5, then messages like these show up on the transcript: > > Error 32 on line 1 of MyTest>>:+= -> 'expecting message pattern' > Error 41 on line 1 of MyTest>>+=& -> 'variable name expected' > > The methods do seem to compile nevertheless--and even run! Maybe the messages come > from some other parser (one for a different language) instead of from Dolphin. I believe they're coming from the parser in the Refactoring Browser. HTH. Bob Jarvis |
Free forum by Nabble | Edit this page |