Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.5K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Referencing held arguments

Posted 4 years ago

I would like to reference by index Held arguments. For example:

Attributes[ func ]={ HoldAllComplete };
func[ args__ ]:=Module[ { argsList,arg1 },
(* In the function I would like to reference the Held args by indexing (e.g. args[[1]] ), 
but anyway I try results in the args being evaluated. *)
argsList=List[ args ]    (* causes the args to be evaluated *)
arg1=argsList[[1]]        (* gives the evaluated arg 1            *)
]

I have spent some time looking at docs, but can't find anything which discusses this. Any suggestions as to where to look will be appreciated.

POSTED BY: Terry Stewart
2 Replies

Thanks, I love example code! I'm new to Wolfram Language, so much to learn, but I learn best by example.

POSTED BY: Terry Stewart
Posted 4 years ago
POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard