The answer by Nate suggests a nice and respectful way to discuss this problem. You could even prefix that by "when researching about [the language] I came across [..]" to show that you found it by genuinly being interested in the subject as opposed to be the bravest and challenge him with a trick question circulating the class.
I decided to write an answer not only to agree with another answer, but to explain why you shouldn't lie like you intend to. I think that it IS (contrary to your intentions) disrespectful to pretend that this question is a genuine one that you have problem with.
If the professor tries to seriously help you and tries to imagine what were you thinking, it might just mislead him in an unfair way. If he asks you "what did you want to accomplish by this code" or "why did you write these lines like that" what will you answer? Going to lie with "I don't know, did I go wrong there?" again?
Even stupider case:
-- Hey, professor, I'm having some trouble, can you give me a hand? I can't understand why is this code not outputing [x].
-- What the hell, moron? Did you find this trick problem on [y] and are trying to fool me now?
-- Oh, I didn't know you read the site...
-- I published this problem on that forum, couldn't you read neither my username nor signature?
Besides, I'd like to challenge your reasons for asking. You haven't told us - is the professor considered (or considers himself) a guru on this language? Or maybe (as usually is the case) his research is somewhat related to programming languages and someone has to introduce you to that language? And is the course actually about the language or does it use the language to teach some programming concept?
Just because the professor seems to know a lot more on the language than most of the students, it doesn't mean that professor is or should be a specialist in the language. Or that he even is/should be interested in the language that much. Maybe he is just using the language as a tool to teach a concept? Often it is the case that subjects like functional programming are taught in a functional programming language like Haskell, but the course is not actually about the language.
Of course, the professor should know the language enough to use it, show it and understand students code, but there is no reason to expect him knowing implementation details or other particularities that your trick might depend on. So just tell him up straight and honest - "I found this trick question". If he has the time and enthusiasm, he might enjoy it and you might have a discussion that benefits both of you. Or maybe he just tells you to not waste the consultation time and f.. off write your thing in an email.