def does not return nil #2029

Closed
steveklabnik opened this Issue Nov 18, 2012 · 12 comments

Comments

Projects
None yet
5 participants
@steveklabnik
Member

steveklabnik commented Nov 18, 2012

I'm not sure when exactly this would matter, but since @rkh brought it up on Twitter...

$ rvm use rbx-head
Using /Users/steve/.rvm/gems/rbx-head

steve at wireless-140 in ~/src/rails on master
$ irb
rubinius-2.0.0rc1 :001 > def foo
rubinius-2.0.0rc1 :002?>   end.nil?
 => false 
rubinius-2.0.0rc1 :003 > ^D%                                                         
steve at wireless-140 in ~/src/rails on master
$ rvm use 1.9.3
Using /Users/steve/.rvm/gems/ruby-1.9.3-p327

steve at wireless-140 in ~/src/rails on master
$ irb
1.9.3p327 :001 > def foo
1.9.3p327 :002?>   end.nil?
 => true 
@rkh

This comment has been minimized.

Show comment Hide comment
@rkh

rkh Nov 18, 2012

Member

Here is a use case:

def foo(a, b = nil)
  launch_missiles if b
end

foo 10,

def bar
end
Member

rkh commented Nov 18, 2012

Here is a use case:

def foo(a, b = nil)
  launch_missiles if b
end

foo 10,

def bar
end
@rkh

This comment has been minimized.

Show comment Hide comment
@rkh

rkh Nov 18, 2012

Member

No response yet? I guess Rubinius is dead ever since Evan left.

QED.

Member

rkh commented Nov 18, 2012

No response yet? I guess Rubinius is dead ever since Evan left.

QED.

@evanphx

This comment has been minimized.

Show comment Hide comment
@evanphx

evanphx Nov 18, 2012

Member

I can't see anyone depending on def's return value and the Rubinius behavior is better. Can you show me real world code that has a problem with returning a CompiledMethod?

  • Evan // via iPhone

On Nov 18, 2012, at 7:38 AM, Konstantin Haase notifications@github.com wrote:

No response yet? I guess Rubinius is dead ever since Evan left.

QED.


Reply to this email directly or view it on GitHub.

Member

evanphx commented Nov 18, 2012

I can't see anyone depending on def's return value and the Rubinius behavior is better. Can you show me real world code that has a problem with returning a CompiledMethod?

  • Evan // via iPhone

On Nov 18, 2012, at 7:38 AM, Konstantin Haase notifications@github.com wrote:

No response yet? I guess Rubinius is dead ever since Evan left.

QED.


Reply to this email directly or view it on GitHub.

@brixen

This comment has been minimized.

Show comment Hide comment
@brixen

brixen Nov 18, 2012

Member

I suggest you use PHP if you want compatibility with all the things done wrong in MRI.

Member

brixen commented Nov 18, 2012

I suggest you use PHP if you want compatibility with all the things done wrong in MRI.

@brixen brixen closed this Nov 18, 2012

@rkh

This comment has been minimized.

Show comment Hide comment
@rkh

rkh Nov 18, 2012

Member

👍

Has someone been working on a metacircular PHP implementation?

Member

rkh commented Nov 18, 2012

👍

Has someone been working on a metacircular PHP implementation?

@brixen

This comment has been minimized.

Show comment Hide comment
@brixen

brixen Nov 18, 2012

Member

I believe Facebook is the biggest commercial effort pushing PHP forward. You may be able to add a backend to the compiler that emits C code to emit PHP instead. I'd first consider emitting Javascript and then use CoffeeScript to emit Haskell, which should have a lot of tools for emitting PHP. However, you may want to emit Scala instead so you can benefit from the Clojure libraries on the JVM.

Member

brixen commented Nov 18, 2012

I believe Facebook is the biggest commercial effort pushing PHP forward. You may be able to add a backend to the compiler that emits C code to emit PHP instead. I'd first consider emitting Javascript and then use CoffeeScript to emit Haskell, which should have a lot of tools for emitting PHP. However, you may want to emit Scala instead so you can benefit from the Clojure libraries on the JVM.

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Nov 18, 2012

lol.

ghost commented Nov 18, 2012

lol.

@rkh

This comment has been minimized.

Show comment Hide comment
@rkh

rkh Nov 18, 2012

Member

At least PHP supports fibers.

Member

rkh commented Nov 18, 2012

At least PHP supports fibers.

@brixen

This comment has been minimized.

Show comment Hide comment
@brixen

brixen Nov 18, 2012

Member

It is impossible to compete with all the goodness that is PHP.

Member

brixen commented Nov 18, 2012

It is impossible to compete with all the goodness that is PHP.

@rkh

This comment has been minimized.

Show comment Hide comment
@rkh

rkh Nov 18, 2012

Member

Yeah, let's just give up.

Member

rkh commented Nov 18, 2012

Yeah, let's just give up.

@brixen

This comment has been minimized.

Show comment Hide comment
@brixen

brixen Nov 18, 2012

Member

Well, I'm not willing to throw in the towel just yet. We return non-nil from def, after all.

Member

brixen commented Nov 18, 2012

Well, I'm not willing to throw in the towel just yet. We return non-nil from def, after all.

@ddfreyne

This comment has been minimized.

Show comment Hide comment
@ddfreyne

ddfreyne Nov 18, 2012

I once started working on a tool that converted Ruby into PHP but I got so confused by this issue that I went ahead and made defs return the harraysh "php" instead.

I once started working on a tool that converted Ruby into PHP but I got so confused by this issue that I went ahead and made defs return the harraysh "php" instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment