Code, for example, discovered in advance (6)
I believe the answer is:
legend
'code' is the definition.
(thesaurus)
'example discovered in advance' is the wordplay.
'example' becomes 'eg'.
'discovered in' means one lot of letters goes inside another.
'advance' becomes 'lend' (I've seen this before).
'eg' put within 'lend' is 'LEGEND'.
'for' is the link.
(Other definitions for legend that I've seen before include "Key" , "Story of mythical beings or events" , "extremely famous person?" , "Very famous member's death" , "The story of Achilles, say" .)