From: Bernhard B. <ma...@ba...> - 2003-06-26 08:15:51
|
Hi Ben, I have it on my todo list, but to be honest: currently it's summer and it's hot and so I have trouble to discipline myself and sit in front of my computer. So please go ahead and implement it - it would take another few weeks for me. I have a third alternative: void setVar(int which_variable, int value); void setVar(String which_variable, String value); int getVar(int which_variable); String getVar(String which_variable); public static final int INHIBIT_COMPLETION = 1; public static final String BASIC_QUOTE_CHARACTERS = "2"; etc. which_variable is always a symbolic constant, so the user won't care if it's an int or a string. If fact, it is your solution (2) with IntVar==int, and StrVar==String. I have no objections using setReadlineVar()... if you prefer more verbose method-names. Bernhard > If you like I'd be happy to implement this, as either: > > or > > (2) > void setReadlineVar(IntVar which_variable, int value); > void setReadlineVar(StrVar which_variable, String value); > int getReadlineVar(IntVar which_variable); > String getReadlineVar(StrVar which_variable); > > public static final IntVar INHIBIT_COMPLETION; > public static final StrVar BASIC_QUOTE_CHARACTERS; > (etc etc) > > This solution allows the single getReadlineVar() / setReadlineVar() > syntax to be used, and the user need not even know about the different > type-specific classes IntVar, StrVar, etc.: > > setReadlineVar(INHIBIT_COMPLETION, true); > > The IntVar and StrVar classes are empty classes that simply allow the > compiler to handle the overloading of getReadlineVar() with different > return types. > > My preferred solution is (2), simply because it's simpler from the user's > point of view. Is this okay with you? > > Ben. |