I know otherwise intelligent people who are prepared to argue for this approach. One way of achieving this would be to actually go and add the necessary methods to the class Symbol, so that symbols could behave like parsers. IfStat:: #if, expression, #then, statement.Īnd have the system figure out that, in this context, you want to denote a parser for a symbol by the symbol directly, much as you would when writing the BNF. The purpose of the rules if and then is to produce a tokenizing parser that accepts the symbols #if and #then respectively. IfStat:: if, expression, then, statement.Īssuming that productions for expression and statement already exist. To define a production for an if statement, you might write: Such methods are often referred to as extension methods in Smalltalk, and the practice is supported by tools such as the Monticello source control system.Īs an example, I’ll use my parser combinator library, which I’ve described in previous posts. One of the points that came up was the custom, prevalent in Ruby and in Smalltalk, of extending existing classes with new methods in the service of some other application or library. Almost everything he said would apply to Smalltalk as well. Chad is a very good speaker, who did an excellent job of conveying the sense of working in a dynamic language like Ruby. While much of the program was in Polish, there were quite a few talks in English.Īmong these was Chad Fowler’s talk on Ruby. The CS festival draws well over a thousand participants the whole thing is organized by students. Krakow is a beautiful city with several universities, and it is becoming a high tech center, with branches of companies like IBM and Google. Earlier this month I spoke at the International Computer Science Festival in Krakow.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |