Variable names not allowed "?" and "!" but method name does - why?

We can write a method name as foo! or foo?; but not the same with
variable names. Like

foo? = 2
# ~> -:1: syntax error, unexpected '='
# ~> foo? = 2

So why such design?

···

--
Posted via http://www.ruby-forum.com/.

You are just using too few of them. See attached script, it works! :wink:

- Matthias

exclam.rb (91 Bytes)

···

Am 30.06.2013 21:29, schrieb Love U Ruby:

We can write a method name as foo! or foo?; but not the same with
variable names. Like

foo? = 2
# ~> -:1: syntax error, unexpected '='
# ~> foo? = 2

So why such design?

"Matthias Wächter" <matthias@waechter.wiz.at> wrote in post #1114002:

You are just using too few of them. See attached script, it works! :wink:

- Matthias

I understand only *English* :).. so the attached script is not helpful
for me :frowning:

···

--
Posted via http://www.ruby-forum.com/\.

@Love U Ruby: ??? It's only a couple of lines of code.

@Matthias: Why not include the code in the email?

···

Am 30.06.2013 22:07, schrieb Love U Ruby:

"Matthias Wächter" <matthias@waechter.wiz.at> wrote in post #1114002:

You are just using too few of them. See attached script, it works! :wink:

- Matthias

I understand only *English* :).. so the attached script is not helpful
for me :frowning:

--
<https://github.com/stomar/&gt;

Sorry ... I wanted to make sure that the UTF-8 stuff is transported
without alteration of any kind.

#!/usr/bin/env ruby
# -*- encoding:utf-8 -*-
a‼=5
p a‼
b⁇=8
p b⁇
c⁉=false
p c⁉

- Matthias

···

Am 01.07.2013 16:54, schrieb sto.mar@web.de:

Am 30.06.2013 22:07, schrieb Love U Ruby:

"Matthias Wächter" <matthias@waechter.wiz.at> wrote in post #1114002:

You are just using too few of them. See attached script, it works! :wink:

- Matthias

I understand only *English* :).. so the attached script is not helpful
for me :frowning:

@Love U Ruby: ??? It's only a couple of lines of code.

@Matthias: Why not include the code in the email?

"Matthias Wächter" <matthias@waechter.wiz.at> wrote in post #1114170:

@Love U Ruby: ??? It's only a couple of lines of code.

@Matthias: Why not include the code in the email?

Sorry ... I wanted to make sure that the UTF-8 stuff is transported
without alteration of any kind.

I am getting error :-

# -*- encoding:utf-8 -*-
a?=5
p a?
b?=8
p b?
c?=false
p c?

···

Am 01.07.2013 16:54, schrieb sto.mar@web.de:

--
Posted via http://www.ruby-forum.com/\.