src/rlisp.rb
# Is the symbol legal RLisp variable ?
# Some that are not:
# * Funny characters
# * Reserved keyword self
# * Ruby constants (anything starting with a capital letter)
#
# * # is not a legal RLisp identifier, it's used by gensym


# is not a legal RLisp identifier, it's used by gensym
# is not a legal RLisp identifier it ' s used by gensym
def rlisp_variable?
    return false if [:self, :true, :false, :nil].include?(self)
    str = to_s
    str =~ /\A[a-zA-Z0-9!$%&*+\-.\/:#<=>?@^_\~]+\Z/ and str !~ /\A[A-Z0-9$@]/
  end
def rlisp_variable? return false if [ :self , :true , :false , :nil ] . include? ( self ) str = to_s str =~ / \A [a-zA-Z0-9!$%&*+ \- . \/ :#<=>?@^_ \~ ]+ \Z / and str !~ / \A [A-Z0-9$@] / end
Is the symbol legal RLisp variable ?
Is the symbol legal RLisp variable ?