[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] Committed change to search location for "startup.rtf" (Mac only)



Hi Dan and everyone,

Well, whatever it is, I will need to override it for student use at Wesleyan. This is not a problem at all, but it raises the following (possibly naive) question:

Why are configuration settings implemented as methods and class methods of Platform rather than as instance variables or class variables? As variables, all system customization could be performed in Main, which
really exists for such purposes.

While we are at it, why not treat Platform as the language equivalent of a ServerOptions and put all standard configuration choices there? This would be much easier for everyone, particularly new users.

For example:

+OSXPlatform {
	initPlatform {
		super.initPlatform;
		defautlRecDir =  "recordings";
		userExtensionDir = this.prUserExtensionDir
	}
	
	prUserExtensionDir { _Platform_userExtensionDir }
}

Then you can write
thisProcess.defaultRecDir = "~/Music/SC3";

Possibly better would be to make these class variables of Platform (after all, an instance of the language can only
run on one Platform),  so you could write

	Platform.defaultRecDir = "~/Documents/audio";

And initPlatform would have to do the same (but you would not have to rewrite userExtensionDir, etc if you did not want to):

	initPlatform {
		super.initPlatform;
		Platform.defautlRecDir =  "recordings";	
		Platform.userExtensionDir = this.userExtensionDir
	}


RJK

On Feb 3, 2008, at 4:09 PM, Dan Stowell wrote:

Hi -

I've committed (svn rev 7221) Ryan's proposed move of the search
location for startup.rtf on Mac. Now it looks in the system's, then
the user's, "Application Support" folders.

I read through the email threads and came to the conclusion that this
was less controversial than the default location for recordings, so it
would be OK to commit. If I've done this out of turn and people feel
it would be wiser to revert then let's discuss, but hopefully is OK.

Dan


Index: build/SCClassLibrary/Platform/osx/OSXPlatform.sc
===================================================================
--- build/SCClassLibrary/Platform/osx/OSXPlatform.sc (revision 7213)
+++ build/SCClassLibrary/Platform/osx/OSXPlatform.sc    (working copy)
@@ -1,7 +1,12 @@
 OSXPlatform : UnixPlatform
 {
        name { ^\osx }
-       startupFiles { ^#["~/scwork/startup.rtf"] }
+
+       startupFiles {
+               var filename = "startup.rtf";
+               ^[this.systemAppSupportDir +/+ filename,
this.userAppSupportDir +/+ filename];
+       }
+
        startup {
                Document.implementationClass.startup;
                // make server window
_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel