Archive for smalltalk

Code H’yung: Ropes, Sprint 3

Posted in smalltalk with tags , , , , on August 12, 2009 by moffdub

Welcome to the Sprint 3 Review of the Ropes h’yung mini-project. As the only person who really matters on this project, I’m happy to report that we have code to show you for our review today!

First, we had to shift some of the goals for this sprint around:

  • apply the Null Object Pattern and refactor where possible
  • refactor append to be purely functional
  • partial implementation of string deletion
  • analysis of string deletion
  • partial implementation of RopeNodeIterator

Let’s start with the first goal: null objects. First I wrote a NullRopeNode:

Read more »

Code H’yung: Ropes, Sprint 2

Posted in smalltalk with tags , , , , on July 29, 2009 by moffdub

Welcome to the Sprint 2 Review of the Ropes h’yung mini-project. As the only person who really matters on this project, I’m happy to report that we have code to show you for our review today!

First, I paid off some technical debt by getting rid of the ill-fated RopeWriter and wrote asString the way God intended:

"InternalRopeNode"
asString
	"answers with a string of this RopeNode"

	(leftRopeNodeChild = nil and:[rightRopeNodeChild = nil]) 
	ifTrue:
	[
		^ ''.
	].

	(leftRopeNodeChild = nil) ifTrue:
	[
		^ rightRopeNodeChild asString.
	].

	(rightRopeNodeChild = nil) ifTrue:
	[
		^ leftRopeNodeChild asString.
	].

	^ (leftRopeNodeChild asString) , (rightRopeNodeChild 
		asString).

"LeafRopeNode"
asString
	"answers with a string of this RopeNode"

	^ stringPayload.

Read more »

Code H’yung: Ropes, Sprint 1

Posted in smalltalk with tags , , , , on July 22, 2009 by moffdub

Welcome to the Sprint 1 Review of the Ropes h’yung mini-project. As the only person who really matters on this project, I’m happy to report that, thanks to support from Reina, we have code to show you for our review today!

The goals for the sprint were:

  • implement Rope data structure and supporting data structures
  • implement append
  • implement asString

I was able to finish all three, with the catch being append, which has been implemented but not optimized.

Here is the main attraction: Rope.

Read more »

Follow

Get every new post delivered to your Inbox.