Arc Forumnew | comments | leaders | submitlogin
2 points by waterhouse 5395 days ago | link | parent

I would normally use 'apropos when I'm sitting at the REPL trying to remember the name of a function (or, more rarely, a global variable bound to a hash-table or something). For 'apropos to work on local variables, I assume you would have to use 'apropos within the lexical environment in which the variable exists. I.e. you would go

  (let thingamajig 2
    (do-stuff)
    ;hmm, what was that variable again? thing-something.
    (aps thing))
Which seems a bit useless to me, as the local variables are printed right there within the block of code you're currently writing. I suppose one could have some macro that creates a huge lexical environment, or something... am I missing your meaning? At any rate, 'namespace-mapped-symbols appears to be blind to local variables:

  > (let ((ach 2))
      (member 'ach (namespace-mapped-symbols)))
  #f
To obtain a list of local variables, I think you would have to hack with ac.scm. Or write a macro that searches/walks your code for lexical variables.