Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/cm/main/specific-symval-fn.sml
ViewVC logotype

View of /sml/trunk/src/cm/main/specific-symval-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 433 - (download) (annotate)
Mon Sep 13 06:57:29 1999 UTC (20 years, 2 months ago) by blume
File size: 1083 byte(s)
symval added; getterSetter changed to { get, set }
(*
 * Building a host/OS-specific environments for CM "preprocessor" variables.
 *
 * (C) 1999 Lucent Technologies, Bell Laboratories
 *
 * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
 *)
functor SpecificSymValFn (structure MachDepVC: MACHDEP_VC
			  val os: SMLofNJ.SysInfo.os_kind) =
    struct
	local
	    val (arch, big, size) =
		case MachDepVC.architecture of
		    "sparc" => ("SPARC", true, 32)
		  | "alpha32" => ("ALPHA", false, 32)
		  | "mipsel" => ("MIPS", false, 32)
		  | "mipseb" => ("MIPS", true, 32)
		  | "x86" => ("X86", false, 32)
		  | "hppa" => ("HPPA", false, 32)
		  | "rs6000" => ("RS6000", false, 32)
		  | "ppc" => ("PPC", false, 32)
		  | arch => GenericVC.ErrorMsg.impossible
			("unknown architecture: " ^ arch)
	    val env0 =
		SymVal.default { arch = arch,
				 big = big,
				 size = size,
				 os = os,
				 version = #version_id GenericVC.version }
	    val er = ref env0
	in
	    fun symval s = let
		fun get () = SymVal.look (!er) s
		fun set v = er := SymVal.define (!er, s, v)
	    in
		{ get = get, set = set }
	    end
	end
    end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0