[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to alias new() in the new allocation framework

djberg96

10/17/2004 12:42:00 AM

Hi all,

What is the proper way to alias "new" in a C extension using the new
allocation framework? In other words, I want Foo.open to be an alias
to Foo.new.

// A basic Foo class

static VALUE foo_allocate(VALUE klass){ ... }
VALUE foo_init(int argc, VALUE *argv, VALUE self){ ... }

void Init_foo(){
...
rb_define_alloc_func(cFoo,foo_allocate);
rb_define_method(cFoo,"initialize",foo_init,-1);
}

Since there is no "new" method, how do create a class method that's an
alias to allocate() + initialize()? Or do I have to write it out
manually myself?

Regards,

Dan
15 Answers

Yukihiro Matsumoto

10/17/2004 4:41:00 AM

0

Hi,

In message "Re: How to alias new() in the new allocation framework"
on Sun, 17 Oct 2004 09:44:25 +0900, djberg96@hotmail.com (Daniel Berger) writes:

|Since there is no "new" method, how do create a class method that's an
|alias to allocate() + initialize()? Or do I have to write it out
|manually myself?

Use rb_class_new_instance() in object.c.

matz.


PhilHibbs

10/2/2008 9:40:00 AM

0

Matt wrote:
> Right now prices are dropping so fast that I'm thinking of stockpiling
> the items till Death Knights will be moving through outland and would
> need the items to level their professions. A bit of gamble though ;)

Look at the old world mats that are needed to skill up - did the
prices go down after 2.0? I don't think so. Maybe they dipped for a
little while, but at one point the price of Essences was so high that
Blizzard made them drop off Outland elementals in order to add more to
the market.

Hoofu, 70 tauren shaman, Argent Dawn (EU)

Stephen Grant

10/2/2008 2:09:00 PM

0


"PhilHibbs" <snarks@gmail.com> wrote in message
news:90ca09ae-e009-453d-9ca0-0eb8c576a9f1@l42g2000hsc.googlegroups.com...
> Matt wrote:
>> Right now prices are dropping so fast that I'm thinking of stockpiling
>> the items till Death Knights will be moving through outland and would
>> need the items to level their professions. A bit of gamble though ;)
>
> Look at the old world mats that are needed to skill up - did the
> prices go down after 2.0? I don't think so. Maybe they dipped for a
> little while, but at one point the price of Essences was so high that
> Blizzard made them drop off Outland elementals in order to add more to
> the market.
>
> Hoofu, 70 tauren shaman, Argent Dawn (EU)

As for primals i think they will become cheaper, as the nothrend equivalent
is going to be "eternals"

Behemoth

10/2/2008 4:13:00 PM

0

On Oct 2, 10:09 am, "Stephen Grant" <sgr...@blueyonder.co.uk> wrote:
> "PhilHibbs" <sna...@gmail.com> wrote in message
>
> news:90ca09ae-e009-453d-9ca0-0eb8c576a9f1@l42g2000hsc.googlegroups.com...
>
> > Matt wrote:
> >> Right now prices are dropping so fast that I'm thinking of stockpiling
> >> the items till Death Knights will be moving through outland and would
> >> need the items to level their professions. A bit of gamble though ;)
>
> > Look at the old world mats that are needed to skill up - did the
> > prices go down after 2.0? I don't think so. Maybe they dipped for a
> > little while, but at one point the price of Essences was so high that
> > Blizzard made them drop off Outland elementals in order to add more to
> > the market.
>
> > Hoofu, 70 tauren shaman, Argent Dawn (EU)
>
> As for primals i think they will become cheaper, as the nothrend equivalent
> is going to be "eternals"

I've noticed Primals market starting to bottom out ... Primal Fires on
my server (one of the most expensive of the Primals aside from the
Primal Nether) has bottomed to 18g from around 30g but Primal Air is
still holding strong at 29g

I can see them dropping a bit when people go for the higher range of
mats ... but later on hold steady because people will spend less time
farming them

i'd sell half of you're stock and keep 1 or 2 stacks or maybe 5 of
them or so for later use if you plan on selling Primals for profit

lcpltom

10/2/2008 4:21:00 PM

0

On Oct 2, 10:09 am, "Stephen Grant" <sgr...@blueyonder.co.uk> wrote:
> "PhilHibbs" <sna...@gmail.com> wrote in message
>
> news:90ca09ae-e009-453d-9ca0-0eb8c576a9f1@l42g2000hsc.googlegroups.com...
>
> > Matt wrote:
> >> Right now prices are dropping so fast that I'm thinking of stockpiling
> >> the items till Death Knights will be moving through outland and would
> >> need the items to level their professions. A bit of gamble though ;)
>
> > Look at the old world mats that are needed to skill up - did the
> > prices go down after 2.0? I don't think so. Maybe they dipped for a
> > little while, but at one point the price of Essences was so high that
> > Blizzard made them drop off Outland elementals in order to add more to
> > the market.
>
> > Hoofu, 70 tauren shaman, Argent Dawn (EU)
>
> As for primals i think they will become cheaper, as the nothrend equivalent
> is going to be "eternals"

It all really depends on profession leveling requirements and
popularity of older profession items and services.

For example, +40 weapon damage is the most common caster weapon
enchant you find on players. It requires Primal Mana. I don't know
what exists for enchanting on the beta, but if there is no new spell
damage (supposing it should be called spellpower now) enchant, +40
will be the best available, and Primal Mana will remain in demand. If
however there is say a +50 spellpower enchant, I can see +40 fading
away. You still occasionally see the +30 spell damage enchant, but I
think there is a level requirement on the +40 enchant.

I doubt primals will be sought after for leveling a profession
though. Most professions can be leveled to 375 without use of any
primals. I know tailoring can. If primals keep their value, it will
be because they are needed for something that WotLK doesn't provide
anything better for.

I already cleaned out my supply of stuff. Even my herbs, though I
didn't have much saved up anyway. I figured it was time to make
storage space for all the mats that I will be collecting later. I
sold off mats as I leveled to 70, later having to go back and either
buy them or grind for them for items and enchants I wanted. This time
I will probably save everything until I hit 80 and make a plan for my
warlock then. No sense in wasting storage space for mats I most
likely won't be using. I'll also have to get all my alts to major
cities so as to provide storage for all the stuff I am gathering.

Behemoth

10/2/2008 4:28:00 PM

0

On Oct 2, 12:21 pm, lcpltom <lcpl...@yahoo.com> wrote:
> On Oct 2, 10:09 am, "Stephen Grant" <sgr...@blueyonder.co.uk> wrote:
>
>
>
>
>
> > "PhilHibbs" <sna...@gmail.com> wrote in message
>
> >news:90ca09ae-e009-453d-9ca0-0eb8c576a9f1@l42g2000hsc.googlegroups.com...
>
> > > Matt wrote:
> > >> Right now prices are dropping so fast that I'm thinking of stockpiling
> > >> the items till Death Knights will be moving through outland and would
> > >> need the items to level their professions. A bit of gamble though ;)
>
> > > Look at the old world mats that are needed to skill up - did the
> > > prices go down after 2.0? I don't think so. Maybe they dipped for a
> > > little while, but at one point the price of Essences was so high that
> > > Blizzard made them drop off Outland elementals in order to add more to
> > > the market.
>
> > > Hoofu, 70 tauren shaman, Argent Dawn (EU)
>
> > As for primals i think they will become cheaper, as the nothrend equivalent
> > is going to be "eternals"
>
> It all really depends on profession leveling requirements and
> popularity of older profession items and services.
>
> For example, +40 weapon damage is the most common caster weapon
> enchant you find on players.  It requires Primal Mana.  I don't know
> what exists for enchanting on the beta, but if there is no new spell
> damage (supposing it should be called spellpower now) enchant, +40
> will be the best available, and Primal Mana will remain in demand.  If
> however there is say a +50 spellpower enchant, I can see +40 fading
> away.  You still occasionally see the +30 spell damage enchant, but I
> think there is a level requirement on the +40 enchant.
>
> I doubt primals will be sought after for leveling a profession
> though.  Most professions can be leveled to 375 without use of any
> primals.  I know tailoring can.  If primals keep their value, it will
> be because they are needed for something that WotLK doesn't provide
> anything better for.
>
> I already cleaned out my supply of stuff.  Even my herbs, though I
> didn't have much saved up anyway.  I figured it was time to make
> storage space for all the mats that I will be collecting later.  I
> sold off mats as I leveled to 70, later having to go back and either
> buy them or grind for them for items and enchants I wanted.  This time
> I will probably save everything until I hit 80 and make a plan for my
> warlock then.  No sense in wasting storage space for mats I most
> likely won't be using.  I'll also have to get all my alts to major
> cities so as to provide storage for all the stuff I am gathering.- Hide quoted text -
>
> - Show quoted text -

I can't check the mats list as I'm at work but there is better then
+40 Spell Dmg (though only in one spell tree for Mages) and that's
Soulfrost and Sunfire .. other classes like Boomkin and warlock should
still be needing +40 Spell Dmg even up to now

Jason Tinling

10/2/2008 4:44:00 PM

0

On Oct 2, 9:21 am, lcpltom <lcpl...@yahoo.com> wrote:

> For example, +40 weapon damage is the most common caster weapon
> enchant you find on players.  It requires Primal Mana.  I don't know
> what exists for enchanting on the beta, but if there is no new spell
> damage (supposing it should be called spellpower now) enchant, +40
> will be the best available, and Primal Mana will remain in demand.  If
> however there is say a +50 spellpower enchant, I can see +40 fading
> away.  You still occasionally see the +30 spell damage enchant, but I
> think there is a level requirement on the +40 enchant.
>


There's a +55 Spellpower enchant in WotLK

lcpltom

10/2/2008 7:32:00 PM

0

On Oct 2, 12:28 pm, Behemoth <mch...@ellensgroup.com> wrote:
> On Oct 2, 12:21 pm, lcpltom <lcpl...@yahoo.com> wrote:
>
>
>
> > On Oct 2, 10:09 am, "Stephen Grant" <sgr...@blueyonder.co.uk> wrote:
>
> > > "PhilHibbs" <sna...@gmail.com> wrote in message
>
> > >news:90ca09ae-e009-453d-9ca0-0eb8c576a9f1@l42g2000hsc.googlegroups.com...
>
> > > > Matt wrote:
> > > >> Right now prices are dropping so fast that I'm thinking of stockpiling
> > > >> the items till Death Knights will be moving through outland and would
> > > >> need the items to level their professions. A bit of gamble though ;)
>
> > > > Look at the old world mats that are needed to skill up - did the
> > > > prices go down after 2.0? I don't think so. Maybe they dipped for a
> > > > little while, but at one point the price of Essences was so high that
> > > > Blizzard made them drop off Outland elementals in order to add more to
> > > > the market.
>
> > > > Hoofu, 70 tauren shaman, Argent Dawn (EU)
>
> > > As for primals i think they will become cheaper, as the nothrend equivalent
> > > is going to be "eternals"
>
> > It all really depends on profession leveling requirements and
> > popularity of older profession items and services.
>
> > For example, +40 weapon damage is the most common caster weapon
> > enchant you find on players. It requires Primal Mana. I don't know
> > what exists for enchanting on the beta, but if there is no new spell
> > damage (supposing it should be called spellpower now) enchant, +40
> > will be the best available, and Primal Mana will remain in demand. If
> > however there is say a +50 spellpower enchant, I can see +40 fading
> > away. You still occasionally see the +30 spell damage enchant, but I
> > think there is a level requirement on the +40 enchant.
>
> > I doubt primals will be sought after for leveling a profession
> > though. Most professions can be leveled to 375 without use of any
> > primals. I know tailoring can. If primals keep their value, it will
> > be because they are needed for something that WotLK doesn't provide
> > anything better for.
>
> > I already cleaned out my supply of stuff. Even my herbs, though I
> > didn't have much saved up anyway. I figured it was time to make
> > storage space for all the mats that I will be collecting later. I
> > sold off mats as I leveled to 70, later having to go back and either
> > buy them or grind for them for items and enchants I wanted. This time
> > I will probably save everything until I hit 80 and make a plan for my
> > warlock then. No sense in wasting storage space for mats I most
> > likely won't be using. I'll also have to get all my alts to major
> > cities so as to provide storage for all the stuff I am gathering.- Hide quoted text -
>
> > - Show quoted text -
>
> I can't check the mats list as I'm at work but there is better then
> +40 Spell Dmg (though only in one spell tree for Mages) and that's
> Soulfrost and Sunfire .. other classes like Boomkin and warlock should
> still be needing +40 Spell Dmg even up to now

Soulfrost is +shadow and +frost, and while its true that warlocks
don't cast frost spells, how many warlocks do you see running around
with FSW which boosts the exact same schools? I have Soulfrost on my
warlock.

However, the mat cost for Soulfrost and Sunfire are quite heavy. I
didn't get Soulfrost until I got a weapon I felt was worthy of it, the
SSO badge caster dagger. Up until then, I had a KoT caster sword with
+40 spell damage. I had that sword for a really long time, so I could
have gone with Soulfrost if I wanted, but like I said, it had to be a
weapon worthy of it.

Its the mat cost that keeps most players from taking those enchants
though. Soulfrost was 12 Void Crystals, 10 Greater Prismatic Shards,
8 Greater Planar Essences, 6 Primal Waters, and 6 Primal Shadows,
compared to +40 spell damage which I believe is just 6 Primal Mana.

The only thing that will impact the demand for +40 is if WotLK
introduces new spell damage enchants for weapons with a mat cost less
than Soulfrost or Sunfire. You start seeing +50 spellpower needing
only 6 eternal mana or something like that, +40 will largely disappear.

lcpltom

10/2/2008 7:32:00 PM

0

On Oct 2, 12:44 pm, Jason Tinling <jason.tinl...@gmail.com> wrote:
> On Oct 2, 9:21 am, lcpltom <lcpl...@yahoo.com> wrote:
>
> > For example, +40 weapon damage is the most common caster weapon
> > enchant you find on players. It requires Primal Mana. I don't know
> > what exists for enchanting on the beta, but if there is no new spell
> > damage (supposing it should be called spellpower now) enchant, +40
> > will be the best available, and Primal Mana will remain in demand. If
> > however there is say a +50 spellpower enchant, I can see +40 fading
> > away. You still occasionally see the +30 spell damage enchant, but I
> > think there is a level requirement on the +40 enchant.
>
> There's a +55 Spellpower enchant in WotLK

And there is my answer.

Jason Tinling

10/2/2008 8:08:00 PM

0

On Oct 2, 12:31 pm, lcpltom <lcpl...@yahoo.com> wrote:
> On Oct 2, 12:44 pm, Jason Tinling <jason.tinl...@gmail.com> wrote:
>
> > On Oct 2, 9:21 am, lcpltom <lcpl...@yahoo.com> wrote:
>
> > > For example, +40 weapon damage is the most common caster weapon
> > > enchant you find on players.  It requires Primal Mana.  I don't know
> > > what exists for enchanting on the beta, but if there is no new spell
> > > damage (supposing it should be called spellpower now) enchant, +40
> > > will be the best available, and Primal Mana will remain in demand.  If
> > > however there is say a +50 spellpower enchant, I can see +40 fading
> > > away.  You still occasionally see the +30 spell damage enchant, but I
> > > think there is a level requirement on the +40 enchant.
>
> > There's a +55 Spellpower enchant in WotLK
>
> And there is my answer.

Check that, there's a +63 SP enchant, but it's 40 Dust, 20 Greater
Eseences and 6 of the new Void Crystals. It's not going to be a "day
one" enchant. In reality, a lot of the current beginning level
enchants require a high quantity of mats, and DEing is pretty stingy.
If you have mats for solid enchants that are yellow or orange, you may
want to hold them to help skill up in WotLK.