For Programmers: Free Programming Magazines  


Home > Archive > Clipper > May 2007 > Re: It's possible to know a name of a codeblock ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: It's possible to know a name of a codeblock ?
Tom Leylan

2007-05-04, 6:55 pm

Hi Albert uhh, Franz :-)

Codeblocks are also known as "anonymous methods" which my definition means
they have no name. So the answer is "no". As Steve Quinn points out
however you can simply agree on what the identifer will be and so long as
everybody abides by the rules that's it's "name." Again as Steve's example
demonstrates you can pass the name along as a parameter.

The other side of the argument is "why would you want to know the name?".
The whole point behind codeblocks is that the code is passed to a routine
that needs to execute it. It shouldn't really be trying to decide what to
do but rather should simply EVAL the codeblock it was handed.

I don't have a direct link but if you drop by: http://www.leylan.com/ and
select the Clipper link and then the "They're Code Blocks" link it will
bring you to an article I wrote in an earlier century on the subject.
Perhaps it can help.

Tom

"albert" <alberto.pecchioni@inwind.it> wrote...
> It's possible to know a name of a codeblock ?
>
> Example:
>
> Codeblock1 : = {|| ..........}
> Codeblock2 := {||................................}
>
> Test(codeblock1)
>
> Test(codeblock2)
>
>
> Function test (cblock)
>
> If cblock = "codeblock1" ?????? <-------- How to know the name ?????
> .........
> Endif
>
> Franz



Hotwheels

2007-05-20, 6:23 am

Katie Holmes touching her boobs!
http://Katie-Holmes-touching-her-bo...hp?movie=726648
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com