Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jrubyc doesn't like the spaceship operator <=> #1844

Closed
rifraf opened this issue Jul 22, 2014 · 3 comments
Closed

jrubyc doesn't like the spaceship operator <=> #1844

rifraf opened this issue Jul 22, 2014 · 3 comments
Milestone

Comments

@rifraf
Copy link

rifraf commented Jul 22, 2014

Output is "Failure during compilation of file fmu_model.rb:
syntax error, unexpected EQUAL"

# --------------------------------------------
class FMU::Model::Variable
# --------------------------------------------

  attr_reader :name, :reference, :input, :output, :description, :start

  def initialize(attributes)
    @name = attributes['name']
    @reference = attributes['valueReference'].to_i
    @input = !!(attributes['causality'] =~ /input/i) || (attributes['variability'] =~ /parameter/i)
    @output = !!(attributes['causality'] =~ /output/i)
    @description = attributes['description']
  end

  define_method("<=>".to_sym) do |other|
    @reference <=> other.reference
  end

  # jrubyc doesn't like the =
  # def <=>(other)
  #   @reference <=> other.reference
  # end
end
@keeguon
Copy link

keeguon commented Oct 8, 2014

Okay I tried to backtrack the commit where jrubyc used to work in conjonction with warbler but it seems none of the version I try can work. However I can remember that with jRuby 1.7.4 + warbler it works so that's a bit odd.

@MSNexploder
Copy link
Contributor

This compiles without problems using 9.1.9.0:

class Variable
  def <=>(other)
    @reference <=> other.reference
  end
end

@kares
Copy link
Member

kares commented May 29, 2017

Great, this has been fixed a while back ... thanks for confirming Stefan.

@kares kares closed this as completed May 29, 2017
@kares kares added this to the JRuby 9.1.8.0 milestone May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants