Skip to content

Commit

Permalink
update FromScratch package.
Browse files Browse the repository at this point in the history
  • Loading branch information
EiichiroIto committed Dec 1, 2020
1 parent 3ef5e22 commit e096b4f
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
addNumberExpressArg: aCharacter selector: aSymbol target: anObject
self
add: aCharacter
builder: [ ExpressionArgMorphWithMenu new
numExpression: (anObject perform: aSymbol) first second asString;
getOptionsSelector: aSymbol;
getOptionsTarget: anObject ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*FromScratch
isNumberString
^ false
3 changes: 3 additions & 0 deletions filetree/FromScratch.package/Array.extension/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "Array"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ coerceArgs: argList

| args specialCommands |
args := argList asArray.
specialCommands := #(#setVar:to:).
(specialCommands includes: selector)
(self script specialCommands includes: selector)
ifFalse: [ "ensure args are numbers where numbers are expected"
args := argList asArray
with: self numberArgFlags
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*FromScratch
isNumberString
^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
block specs
specialCommands
^ #(#setVar:to:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
special ops
doForever
"Executes one iteration of a forever loop."

"Right now, the forever special form is at the top of the stack. We're going to add two more things on top of this: (1) a frame for evaluating the blocks in the forever block, and (2) a frame that just results in yielding control. That way we'll evaluate the contents of the block, give up control, and do it all again."

| blocks |
"Remember blocks to evaluate before we clobber the stack."
blocks := stackFrame expression firstBlockList.

"When we're all done with these blocks, we want to yield."
self pushStackFrame: (ScratchStackFrame new shouldYield: true).

"First, we want to evaluate the blocks inside the loop."
self pushStackFrame: (ScratchStackFrame new expression: blocks)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
accessing
deploySystem
"self deploySystem"
(self confirm: 'Deploying System?')
ifFalse: [ ^ self ].
World closeAllWindowsDiscardingChanges.
FreeTypeFontProvider current updateFromSystem.
MCRepositoryGroup
allSubInstancesDo: [ :gr | gr repositories do: [ :r | gr removeRepository: r ] ].
IceRepository registry removeAll.
IceCredentialStore current
in:
[ :store | store allCredentials do: [ :each | each removeFrom: store ] ].
Smalltalk cleanUp: true except: {} confirming: false.
Deprecation
raiseWarning: false;
showWarning: false.
NoChangesLog install.
NoPharoFilesOpener install.
Stdio useNullStreams.
MCCacheRepository uniqueInstance disable.
EpMonitor reset.
5 timesRepeat: [ Smalltalk garbageCollect ].
Smalltalk snapshot: true andQuit: true

0 comments on commit e096b4f

Please sign in to comment.