RFC - One word alias for require_relative

I

Ilias Lazaridis

Hey everyone.

I'm new to Ruby and finding the language pretty neat.

I think this might help in solving Ilias' problem of finding a word:

enum = ('aaaaaaa'..'zzzzzzz').to_enum

enum.each do |word|
        puts word + "\n"
end

He can go through each one and find what he likes.

You're welcome. ;)

Ah!

A creative Off-topic-Troll.

You'll made a career on this list!

..
 
M

Mike Moore

[Note: parts of this message were removed to make it a legal post.]

The OP asked for comments on the proposal for a new, more descriptive name
for "require_relative". I have a hard time remembering if it is
"require_relative" or "relative_require", which causes me pain and grief
whenever I reach for "require_relative" as I'm coding. Because of this I
would like to leave my comment.

As I understand it, "require_relative" was introduced because of a
fundamental change to LOAD_PATH in Ruby 1.9. Having the current directory in
the LOAD_PATH was deemed to be a problem, and was removed for security
concerns and a sense of correctness. This meant that "require" would no
longer load files based on where the loading files location. Now, obviously,
this caused issues because behavior was changed, and a way was needed to fix
the broken code. Hence "require_relative" was introduced as the solution.

The stated question that began this thread is what alternative to
"require_relative" would you choose, asking only that the new single word
was 7 characters or less. I have a word in mind, but let me first
hypothesize on why "require_relative" was chosen in the first place. On the
surface having a multi-word name for this functionality seems to go counter
intuitive to Ruby's ease and flow that we all love. Why would something so
basic have a name that was so uncomfortable? As I said earlier, I have a
hard time even keeping the name right in my head! Why would the Ruby culture
create and propagate something so out of place and ill-tasting?

Why indeed. I have given this much thought. I have pondered on this subject
throughout the interactions on this thread. Why is it so wordy? Almost
overly descriptive? Where is the sweetness I am used to? Why hasn't Ruby
opened her arms to embrace me with her syntactic sugar? Why? Why Matz, why?

Could it be that "require_relative" is just a bad idea? Could it be that
"require_relative" was left intentionally wordy as some sort of syntax
vinegar to push people away from using that functionality? Not a punishment
per se, but a subtle reminder that something is wrong with the assumptions
that the code is making? A sore thumb on otherwise healthy code? But if that
is the case, then what shorter name can we give to "relative_require" that
would still communicate how ill-fitting and out of place the functionality
is to Ruby? Preferably in 7 characters or less?

My friends, I have the answer:

alias ilias require_relative

I sincerely hope my suggestion, a single word with 7 characters or less, can
help bring some closure to this topic.

~Mike
 
M

Mike Moore

[Note: parts of this message were removed to make it a legal post.]

2011/6/16 Ilias Lazaridis said:
I guess it's time to give up.

It's just to much off-topic trolling.

Trolling? I'm offended! I am certainly not trolling. My message was very
on-topic. And my suggested solution works. I even tested it and everything.
 
I

Ilias Lazaridis

[Note:  parts of this message were removed to make it a legal post.]

2011/6/16 Ilias Lazaridis said:
I guess it's time to give up.
It's just to much off-topic trolling.

Trolling? I'm offended! I am certainly not trolling. My message was very
on-topic. And my suggested solution works. I even tested it and everything.

I must admit, you are a high-quality troll - but still a troll.

..
 
M

Mike Moore

[Note: parts of this message were removed to make it a legal post.]



While "involve" is a single word, it is 8 characters and not 7 characters or
less. It appears that "ilias" is the only acceptable answer.
 
I

Ilias Lazaridis


This one sounds good!

I think I've a new favourite!

involve 'lib/alter'
locally 'lib/alter' # locally located file

uniload 'lib/alter' # universal load
request 'lib/alter' #
include 'lib/alter' # the commonly known "include"

relative 'lib/alter' #

..
 
S

Sam Duncan

You can't count.

And furthermore, you can't read.

optional:
* ideally a 7 letter word

Who is the real troll here?
 
M

Mike Moore

[Note: parts of this message were removed to make it a legal post.]

You can't count.

And furthermore, you can't read.


optional:
* ideally a 7 letter word

Who is the real troll here?


Why are you guys picking on me? I gave you a perfectly acceptable solution!
 
P

Phillip Gawlowski

You can't count.

And furthermore, you can't read.

It *is* seven letters.

Of course, it suffers from a glaring similarity with the include
keyword, hinting more at extension of something that exists, rather
than the requirement of something, but you win some and you lose some.

--=20
Phillip Gawlowski

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Leibnitz
 
A

Adam Prescott

[Note: parts of this message were removed to make it a legal post.]

This one sounds good!

I think I've a new favourite!

70 messages in and the topic becomes clear: entertain me with 7-letter
words.
 
P

Phillip Gawlowski

What becomes clear is this: who are the trolls.

Your bad English is showing: Troll. Singular.

--=20
Phillip Gawlowski

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Leibnitz
 
M

Matt Harrison

[Note: parts of this message were removed to make it a legal post.]

This one sounds good!
I think I've a new favourite!

70 messages in and the topic becomes clear: entertain me with 7-letter
words.

What becomes clear is this: who are the trolls.

I really wish I could be there when you go for a job interview, or
attempt to bid on a contract and they recognise your name. I guess the
archives for list this (or anywhere you have infected) would be the best
resume ever...for warning the employer. Maybe that's already happened
and this is misplaced vengeance.
 
M

Mike Moore

[Note: parts of this message were removed to make it a legal post.]

What becomes clear is this: who are the trolls.

That is the second time you implied I was a troll. Even after I told you
directly that I am not a troll. I don't understand why you would do this.
You don't know me. I did nothing but try to help you and yet you repay my
kindness with libel? This defamation will not stand!
 
M

Matt Harrison

That is the second time you implied I was a troll. Even after I told you
directly that I am not a troll. I don't understand why you would do this.
You don't know me. I did nothing but try to help you and yet you repay my
kindness with libel? This defamation will not stand!

I would throw some legal threats at him. Look at his previous posts if
you're not sure how.

Myself, I'm still waiting to see when we're all getting sued for
libelling him...should be exciting.
 
I

Ilias Lazaridis

This one sounds good!

I think I've a new favourite!

involve 'lib/alter'
locally 'lib/alter' # locally located file

uniload 'lib/alter' # universal load
request 'lib/alter' #
include 'lib/alter' # the commonly known "include"

relative 'lib/alter' #

"involve", reminds me "include" (which I would use naturally, but it's
used to describe "mixin")

After reviewing some dictionaries, I like the term "involve" even more
than "include".

-

I leave the trolls now alone to discuss my English skills and to
theorize about my job interviews and whatever other personal things
they may find. They're trolls, don't be to hard in judging them.

Time for some episodes of serials!

..
 
P

Phillip Gawlowski

A creative Off-topic-Troll.

You'll made a career on this list!

Feel free to leave. Go with God, but go.

--=20
Phillip Gawlowski

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Leibnitz
 
D

David Masover

[...]
=20
I've read everything, but I'll not comment.
=20
Do me a favour, please.

Let me think... no. You haven't even been cooperative when I have been tryi=
ng=20
to give you the best answer to your question, by at least providing enough=
=20
context so that I understand why it's a real problem. And it gets more=20
personal from there.
Can you please try to find one word (ideally with 7 chars),
independent of you think about the need.
=20
Just as an exercise.

As "just an exercise", it's a pointless waste of time. At best, it might=20
enhance my vocabulary, which doesn't need the help. It also doesn't look li=
ke=20
fun. About the only other reason I'd do it as "just an exercise" is as a fa=
vor=20
to you, and given your conduct so far, replying to you is already a favor.

What I would be happy to do is discuss why this is needed, and how/whether =
to=20
get it included into the core, or what a good name might be outside of your=
=20
artificial one-word-7-char constraint.

But I'm not going to jump through hoops just because you say so.
I'd normally refuse to do so even for people I respect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top