Re: automatically call functions based on arguments



On Apr 29, 4:09 am, normanj <nii2...@xxxxxxxxx> wrote:
Suppose there are several functions (or macros):
  func-aa-1-1
  func-aa-2-1
  func-bb-1-3

I'm not entirely sure what you're trying to accomplish here, but where
are FUNC-AA-1-1, FUNC-AA-2-1, etc, coming from? If they already exist
for you, I have nothing. But if you're writing those yourself, too,
I'd
just use a generic function with a lot of EQL specifiers:

(defmethod call-function ((sym (eql 'aa)) (a1 (eql 1)) (a2 (eql 1)))
(frobnicate-wisely-on-aa-1-1))

Basically, just ask CLOS to handle the lookup table for you.

--
wm
.



Relevant Pages

  • Re: Martin Fowler talks about Lisp...
    ... > - fields are best represented by Common Lisp object's slots ... I have Keenes book and several examples, ... this post and rethinking the problem, I get a glimmer of this CLOS ... I think I'm so used to writing all the boilerplate ...
    (comp.lang.lisp)
  • Re: Row cannot be located for updating error (ADO)
    ... "DBEdit1 the field double clicked) in the OnDoubleClick event is writing ... directly to the database but the data aware controls are writing to the ... >>lookup value) dependant on the users selection this is then saved to the ... > I assume your query is a Join using fields that come from the table your ...
    (borland.public.delphi.database.ado)
  • Re: Vlookup with nested IF
    ... formula to accomplish... ... I guess I figured I'd be able to sort it out ... once I got the lookup issue resolved, ... above my pay grade and I'm a little uncertain of where to insert it. ...
    (microsoft.public.excel.misc)
  • Re: Lookup Function
    ... referencing the contents of a cell. ... where Stain Only is a column header in my table. ... but does not accomplish what I want. ... you can use TEXT in lookup tables. ...
    (microsoft.public.excel.misc)
  • Re: Permission
    ... Just XP's built in burning features? ... Packet writing is what allows the operating system to ... There are other 3rd party programs that accomplish ...
    (microsoft.public.windowsxp.security_admin)