PreviousUpNext

15.4.124  src/app/makelib/tools/main/lsplit-arg.pkg

## lsplit-arg.pkg
## (C) 2002 Lucent Technologies, Bell Laboratories
## Author: Matthias Blume (blume@research.bell-lab.com)

# Compiled by:
#     src/app/makelib/makelib.sublib

#   Convert string representation of a lambda-plitting specification
#   into something matching controls::inline::localsetting.
#   (That type is simply Null_Or( Null_Or( Int ) ), so we do all this without
#   actually referring to that package in order to avoid additional
#   static dependencies.)



###            "Beware short answers to long questions.
###             Simple solutions to complex problems always fail."



package lsplit_arg: (weak)
api {
    arg:  String ->  Null_Or( Null_Or( Null_Or( Int ) ) );
}
{
    use_default
        =
        NULL;

    suggest =  THE;

    fun arg "default"  =>  THE use_default;
        arg "infinity" =>  THE (suggest (THE 100000000));
        arg "on"       =>  THE (suggest (THE 0));
        arg "off"      =>  THE (suggest NULL);

        arg n
            =>
            case (int::from_string n)
              
                 THE i =>  THE (suggest (THE i));
                 NULL  =>  NULL;
            esac;
    end;
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext