I found that the program to check if the scoping is lexical or dynamic is the one given below (source: http://inst.eecs.berkeley.edu/~cs61a/su10/resources/sp11-Jordy/scope/)
(define test
(let ((scope 'lexical))
(lambda () scope)))
(let ((scope 'dynamic))
(test))
But how can this work? This should always print 'lexical (irrespective of whether the scope is lexical or dynamic) right? since in the local scope of the body of the first 'let' , scope is always defined to be 'lexical.. Please correct me if i am wrong