Name: McCarthy's Ghost 2015-06-25 21:22
And why is it Racket?
(def bit-bucket-writer
(proxy [java.io.Writer] []
(write [buf] nil)
(close [] nil)
(flush [] nil)))
(defmacro noprint
"Evaluates the given expressions with all printing to *out* silenced."
[& forms]
`(binding [*out* bit-bucket-writer]
~@forms))
(noprint
(println "Hello, nobody!"))
java.io.WriterDROPPED
bool AreParanthesesBalanced(string exp)
{ stack<char> S;
for(int i =0;i<exp.length();i++)
{ if(exp[i] == '(' || exp[i] == '{' || exp[i] == '[')
S.push(exp[i]);
else if(exp[i] == ')' || exp[i] == '}' || exp[i] == ']')
{ if(S.empty() || !ArePair(S.top(),exp[i]))
return false;
else
S.pop(); }}
return S.empty() ? true:false; }
return S.empty() ? true:false;