Yes, a few different ways:

1) The entire file is parsed so if you have a word that is available in
0.98 but not in 0.97, you either have to call it dynamically:

    "vm-version" "system" lookup-word execute( -- string )

or

2) Make separate files for 0.97 and 0.98, unfortunately we don't have good
version words prior to 0.98, but you could do something like this:

   "vm-version" "system" lookup-word [
        execute( -- string ) ".factor-rc-" prepend run-file
    ] [
        ".factor-rc-0.97" run-file
    ] if*



On Tue, May 24, 2016 at 12:19 PM, Martin Saurer <martin.sau...@bluewin.ch>
wrote:

> Dear all,
>
> Is there a way to conditionally execute words?
>
> For example: In one image "fuel" is loaded. In another image "fuel" is not
> loaded.
> Or: In Factor 0.98 there is a word "vm-version". In Factor 0.97 there is
> no such word.
>
> Is it possible to write a .factor-rc startup file that handles different
> environments and/or
> Factor versions?
>
> In Python I'm doing this the following way:
>
> if sys.version_info[0] == 2:
>   from BaseHTTPServer import BaseHTTPRequestHandler
>   from BaseHTTPServer import HTTPServer
> else:
>   from http.server    import BaseHTTPRequestHandler
>   from http.server    import HTTPServer
>
> Many thanks in advance.
>
> Martin
>
>
>
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data
> untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to