Blogs

Lights and shadows of floating point in GNU Smalltalk

Tagged:  •    •    •  

http://www.fourmilab.ch/fourmilog/archives/2007-10/000906.html

For a dynamically-typed pure object-oriented language, the performance delivered by GNU Smalltalk is impressive. The benchmark ran more than twice as fast as Python and 3.4 times the speed of Ruby—“modern” languages often considered descended from Smalltalk. GNU Common Lisp in compiled mode just edged out GNU Smalltalk by about 2%.

Experiences with GNU Smalltalk

Tagged:
Parser: partially completed
http://16languages.blogspot.com/2007/10/ive-found-myself-creating-kind-of.html
El Smalltalk que no miramos (Spanish)
http://diegacho.blogspot.com/2007/10/el-smalltalk-que-no-miramos.html
New GNU Smalltalk Site Launched
http://onsmalltalk.com/programming/smalltalk/new-gnu-smalltalk-site-launched/
Gnu-Smalltalk a un site web (French)
http://doesnotunderstand.free.fr/?p=406

List comprehension using select and collect

In trying to figure out the "Smalltalk way" to do things like list comprehensions I stumbled across some very neat functionality:

Smalltalk does not have list comprehensions, but it does have higher-order map and filter methods, called collect and select respectively.

coll := ((1 to: 100) select: [:x| ( x * x ) > 3]) collect: [:x | (x * 2)].

You can try this out in gst pretty easily to see the result:

st> | coll |

Hunting down CP1252 with Iconv

Tagged:

I was looking for ways to improve a character encoding guesser in PHP, and decided that it was time to look at Iconv.

One important step to understanding how encoding or "charsets" works in GST is to understand that it is very similar to the ISO C90 model. We reinterpret the traditional String just as C strings were reinterpreted; a String is no longer quite what it appears to be.

A terrifying Presource macro: #tclCase:choose:

Tagged:

In reference to a comment about Tcl switch, enjoy a #tclCase:choose: macro for Presource. I reproduce its class comment here:

TclSwitchMacro comment:
I expand the #tclCase:choose: pseudo-message macro, which efficiently implements something approximating the Tcl `switch' command.

A #tclCase:choose: message looks like this:

 someInput tclCase: #(#regex #nocase) choose:
     {'^<?xml' -> [#xmlFile].
      '<html>' -> [#htmlFile]}.

Syndicate content

User login