alien.strings: change how string>{cpu,os} works.
parent
4fee8bd2cb
commit
84fe3deff8
|
@ -87,9 +87,19 @@ M: byte-array symbol>string utf8 alien>string ;
|
|||
|
||||
M: array symbol>string [ utf8 alien>string ] map ", " join ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: special-object>string ( n -- str )
|
||||
special-object utf8 alien>string ;
|
||||
|
||||
: string>cpu ( str -- cpu )
|
||||
{ x86.32 x86.64 arm ppc.32 ppc.64 } [ name>> = ] with find nip ;
|
||||
|
||||
: string>os ( str -- os )
|
||||
{ windows macosx linux } [ name>> = ] with find nip ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
[
|
||||
OBJ-CPU special-object>string string>cpu \ cpu set-global
|
||||
OBJ-OS special-object>string string>os \ os set-global
|
||||
|
|
|
@ -36,30 +36,6 @@ UNION: unix macosx linux ;
|
|||
|
||||
: vm-compile-time ( -- string ) \ vm-compile-time get-global ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
CONSTANT: string>cpu-hash H{
|
||||
{ "x86.32" x86.32 }
|
||||
{ "x86.64" x86.64 }
|
||||
{ "arm" arm }
|
||||
{ "ppc.32" ppc.32 }
|
||||
{ "ppc.64" ppc.64 }
|
||||
}
|
||||
|
||||
CONSTANT: string>os-hash H{
|
||||
{ "windows" windows }
|
||||
{ "macosx" macosx }
|
||||
{ "linux" linux }
|
||||
}
|
||||
|
||||
: string>cpu ( str -- class )
|
||||
string>cpu-hash at ;
|
||||
|
||||
: string>os ( str -- class )
|
||||
string>os-hash at ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
: image-path ( -- path ) \ image-path get-global ;
|
||||
|
||||
: vm-path ( -- path ) \ vm-path get-global ;
|
||||
|
|
Loading…
Reference in New Issue