On Sat, 09 Jan 2010, Mindaugas Kavaliauskas wrote:

Hi,

> >>RETURN &("@" + cFunc + "()"):exec(...)
> >
> >   RETURN &cFunc( ... )
> >is much simpler :)
> I was sure, that it should be more simple way than proposed by me. I
> (almost) never use macro, and do not know its syntax...

Above is Clipper compatible feature.
Harbour has also extnsion not existing in Clipper which allows to use
macro messages, i.e.:

   proc main()
      local o, msg := "cargo"
      o := errorNew()
      ? o:&msg
      o:&msg := "assign"
      ? o:&msg
   return


[...]
> I'm not sure if it's intentional, but you've used array of hashes
> instead of plain hash here...

Sorry my typo when I was formatting the code in the message.

> If you find this method not less flexible, I think we should use
> this method to define rpc filter. It look more clear (no lRaw,
> lCheck is required) and faster than single rpc filter function
> containing IF lCheck branching and macro evaluation.
> It also uses the same technique as __AXREGISTERHANDLER() hash. Usage
> of {"func"=>@func(),...} also solves a problem of function REQUEST.
> &cFunc() requires REQUESTs on server side to force linkage of
> required functions.

Yes, but still one problem is open. In some protocols user may want to
change set of available (pseudo) functions during execution, i.e. he may
want to add some user ID and password identification and start with
only commands like "Login:" and "Passwd:", and then after successful
authentication he may want to chose different command sets for each
user so we have to allow to each change the hash array in open connections
Because we do not pass a pointer to connection handler then user will
have to use codeblocks to pass his own parameters to executed function
or use some non structural solutions like thread local static variables.
Anyhow the idea of using hash item seems to be quite clean so probably
I'll implement it.

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to