Cipher book for ruby

Hi all ruby gurus there,

I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…

I encountered a symbol I don’t understand, may be simply I didn’t read
the manual careful enough – sorry.

@@var={ } ??

I knew that [ ] is for array, but what is { }?

There are a lot such cryptic things, some I know some I don’t, such as

%w, << === < ! ~ $_ …

I do hope there are a quick reference of these horrible things. :-p

Shannon

Hi Shannon,

Hi all ruby gurus there,

I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…

I’m expecting anyone would be in favor of various improvements
to our online documentation. Perhaps if you begin such a
document…? :slight_smile:

I encountered a symbol I don’t understand, may be simply I didn’t read
the manual careful enough – sorry.

@@var={ } ??

I knew that is for array, but what is { }?

The print version of Programming Ruby has a truly impressive and
useful index. In it, you’ll find:

{…}
hash literal 11, 206
in pattern 61, 209
see also Block

Or… never underestimate IRB:

{}.class
Hash

Aha!

Regards,

Bill

···

From: “Shannon Fang” xrfang@hotmail.com

Hi –

Hi all ruby gurus there,

I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…

I thought there was something like that around (a concordance to the
online pickaxe) but I can’t seem to pinpoint it (assuming it actually
exists in the first place). Anyway, you might also be interested in
the rubydoc book project: http://www.rubydoc.org/book. It’s an
ongoing, online, collaborative Ruby book.

If you do start a new documentation project, I’d encourage you not to
use a name that makes it sound like Ruby is somehow mystifying or
cryptic in the first place. Ruby is actually unusually clear and
transparent in its syntax. Of course there are things whose meaning
isn’t clear until you learn them specifically – but that’s true in
any programming language, and it would be misleading to give the
impression that learning Ruby equates to demystifying it.

David

···

On Sun, 1 Dec 2002, Shannon Fang wrote:


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.

martin

···

Shannon Fang xrfang@hotmail.com wrote:

Hi all ruby gurus there,

I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…

Hi all ruby gurus there,

I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…

This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.

martin

That would be good fodder for the FAQ as well. A question “What on earth do
the following symbols mean…?” would be a good catch-all.

Gavin

···

From: “Martin DeMello” martindemello@yahoo.com

Shannon Fang xrfang@hotmail.com wrote:

Hi all,

My feeling toward C++, and ruby, and any other language is that when you
learn it more, it becomes more cryptic. Ruby is in deed very impressive,
powerful, and easy to read. If I write my own program in ruby, I may not
use anything like symbol in years, but when I try to read other’s
program, I will see it, and then I will try painfully to find out what
does that mean, and miserablly failed.

In fact, after some suggestion here, I read chap 18 “the ruby
programming language” again, and found explanation of most cryptic
historic symbols borrowed from perl. But it is still hard to lookup in
an emergency. In the document it follows a printed format referring to
page 202, for example. But HTML help file don’t have page at all.

Hence, what I suggested is a proper index of every sytactic elements in
the help file. Bill suggested that the printed version already have that.
Why not the online version?

Regards,
Shannon

···

On Sun, 1 Dec 2002 12:09:16 +0900 dblack@candle.superlink.net wrote:

Hi –

On Sun, 1 Dec 2002, Shannon Fang wrote:

Hi all ruby gurus there,

I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…

I thought there was something like that around (a concordance to the
online pickaxe) but I can’t seem to pinpoint it (assuming it actually
exists in the first place). Anyway, you might also be interested in
the rubydoc book project: http://www.rubydoc.org/book. It’s an
ongoing, online, collaborative Ruby book.

If you do start a new documentation project, I’d encourage you not to
use a name that makes it sound like Ruby is somehow mystifying or
cryptic in the first place. Ruby is actually unusually clear and
transparent in its syntax. Of course there are things whose meaning
isn’t clear until you learn them specifically – but that’s true in
any programming language, and it would be misleading to give the
impression that learning Ruby equates to demystifying it.

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

Hi Martin,

···

On Sun, 1 Dec 2002 17:02:03 +0900 Martin DeMello martindemello@yahoo.com wrote:

This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.

I would like to post a serie of questions, and we can make it complete
collaboratively. But I am sorry that I don’t know what is wiki at all. I
read the rubygarden,org page, I found that if I post question there, it
will be similar to rubytalk archive, which is not very easy to index,
and search. Any suggestion?

Shannon

[On funny symbols]
That would be good fodder for the FAQ as well. A question “What on earth do
the following symbols mean…?” would be a good catch-all.

Gavin

That said, sooner or later, if somebody wants to become any good at Ruby, they
have to read some book, and then they will understand all the symbols anyway.
So why not make it sooner?

That said, I still find “class << self” very mystifying.

Gavin

···

From: “Gavin Sinclair” gsinclair@soyabean.com.au

Hi Gavin,

That would be good fodder for the FAQ as well. A question “What on earth do
the following symbols mean…?” would be a good catch-all.

I don’t like this kind of index :). A question can only address one
symbol, what I prefer, from a new user perspective is something like
following:

<<
Array,
Date
Class (inheritance)

:
Symbol
<
comparison (less than)
Class (Object based…)

etc. Which is very simple to index and search…

Thanks.
Shannon

···

On Sun, 1 Dec 2002 19:27:09 +0900 “Gavin Sinclair” gsinclair@soyabean.com.au wrote:

Hi –

Hi all,

My feeling toward C++, and ruby, and any other language is that when you
learn it more, it becomes more cryptic. Ruby is in deed very impressive,
powerful, and easy to read. If I write my own program in ruby, I may not
use anything like symbol in years, but when I try to read other’s
program, I will see it, and then I will try painfully to find out what
does that mean, and miserablly failed.

I think that as you become more familiar with the learning resources
available, you’ll start finding answers more quickly. No one has
tried to mystify or conceal any of this :slight_smile:

In fact, after some suggestion here, I read chap 18 “the ruby
programming language” again, and found explanation of most cryptic
historic symbols borrowed from perl. But it is still hard to lookup in
an emergency. In the document it follows a printed format referring to
page 202, for example. But HTML help file don’t have page at all.

That’s because it’s an online version of a printed book, and the page
numbers aren’t included. Not that they couldn’t be… but hey, this
was a pioneering effort in the area of putting an in-print trade book
on the Web for free, so there are a few things to work out :slight_smile:

Hence, what I suggested is a proper index of every sytactic elements in
the help file. Bill suggested that the printed version already have that.
Why not the online version?

That’s fine – I was only suggesting not unnecessarily labeling Ruby
as “cryptic” or “mystifying”.

David

···

On Sun, 1 Dec 2002, Shannon Fang wrote:


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

Hi all,

My feeling toward C++, and ruby, and any other language is that when you
learn it more, it becomes more cryptic. Ruby is in deed very impressive,
powerful, and easy to read. If I write my own program in ruby, I may not
use anything like symbol in years, but when I try to read other’s
program, I will see it, and then I will try painfully to find out what
does that mean, and miserablly failed.

You won’t program Ruby for long without using

class Example
attr_reader :foo, bar

end

module Blah

module_method :quux
end

So symbols are just part of Ruby growing pains. I never had any problem with
them. I happily understood them in attr_reader without knowing exactly what
they were. When the time came for me to delve into them, I had online PickAxe
and dead-tree “Ruby in a Nutshell”. Everyone who’s serious about programming
Ruby should have at least one book. Online documentation can’t do everything.

Gavin

···

From: “Shannon Fang” xrfang@hotmail.com

A wiki is a world-editable webpage. They’re fun :slight_smile:

http://www.rubygarden.org/ruby for the wiki
http://www.rubygarden.org/ruby?Notes_About_This_Site for how it works
and
http://www.rubygarden.org/ruby?SandBox for a safe place to experiment

martin

···

Shannon Fang xrfang@hotmail.com wrote:

Hi Martin,

On Sun, 1 Dec 2002 17:02:03 +0900 > Martin DeMello martindemello@yahoo.com wrote:

This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.

I would like to post a serie of questions, and we can make it complete
collaboratively. But I am sorry that I don’t know what is wiki at all. I
read the rubygarden,org page, I found that if I post question there, it
will be similar to rubytalk archive, which is not very easy to index,
and search. Any suggestion?

Hi Gavin,

That would be good fodder for the FAQ as well. A question “What on earth
do
the following symbols mean…?” would be a good catch-all.

I don’t like this kind of index :). A question can only address one
symbol, what I prefer, from a new user perspective is something like
following:

I respectfully disagree. We can’t have a separate question for each symbol -
it would result in blowout.

I’ve posted a proposed FAQ entry for feedback, containing your suggestions
(except class names, which are far from cryptic) and several more. See what
you think.

Gavin

···

From: “Shannon Fang” xrfang@hotmail.com

On Sun, 1 Dec 2002 19:27:09 +0900 > “Gavin Sinclair” gsinclair@soyabean.com.au wrote:

Gavin,

You won’t program Ruby for long without using

class Example
attr_reader :foo, bar

end

module Blah

module_method :quux
end

So symbols are just part of Ruby growing pains. I never had any problem with
In deed, we follow nearly the same route, before I knew there’s a class
called symbol, there are no growing pains at all!

I thought attr_reader is a special notation, I never realised that it is
a method. and :name after attr_reader is just a special syntax, and
:name is indeed same as name, but the “:” is required by the attr_reader
notation.

After I learned that attr_reader is a method, and :name is a symbol, and
:name is not linked to name, my classical word collapsed, and I entered
a new world of modern ruby… Just like transition to the world of
Newton to Einstein… :slight_smile:

Shannon

···

On Sun, 1 Dec 2002 22:30:26 +0900 “Gavin Sinclair” gsinclair@soyabean.com.au wrote:

The following analogy might help: think of a string as a frame in which
several blocks of movable type are set, and a symbol as a single block
of metal, engraved with a complete word, and given a serial number which
is stored in a large list of serial numbers indexed by name, so you can
find it quickly.

martin

···

Shannon Fang xrfang@hotmail.com wrote:

After I learned that attr_reader is a method, and :name is a symbol, and
:name is not linked to name, my classical word collapsed, and I entered
a new world of modern ruby… Just like transition to the world of
Newton to Einstein… :slight_smile:

:slight_smile: A good feeling, no?

May all your surprises be pleasant ones…

Hal

···

----- Original Message -----
From: “Shannon Fang” xrfang@hotmail.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, December 01, 2002 8:23 AM
Subject: Re: Cipher book for ruby

I thought attr_reader is a special notation, I never realised that it is
a method. and :name after attr_reader is just a special syntax, and
:name is indeed same as name, but the “:” is required by the attr_reader
notation.

After I learned that attr_reader is a method, and :name is a symbol, and
:name is not linked to name, my classical word collapsed, and I entered
a new world of modern ruby… Just like transition to the world of
Newton to Einstein… :slight_smile: