我将mruby 1.3.0 (2017-7-4)
与build_config.rb
:
MRuby::Build.new do |conf|
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
enable_debug
conf.gembox 'default'
conf.gem :git => 'https://github.com/mattn/mruby-uv'
conf.gem :git => 'https://github.com/mattn/mruby-http'
conf.gem :git => 'https://github.com/iij/mruby-socket'
conf.gem :git => 'https://github.com/luisbebop/mruby-polarssl.git'
conf.gem :git => 'https://github.com/iij/mruby-digest'
conf.gem :git => 'https://github.com/iij/mruby-pack'
conf.gem :git => 'https://github.com/matsumoto-r/mruby-simplehttp.git'
conf.gem :git => 'https://github.com/matsumotory/mruby-httprequest'
conf.gem :git => 'https://github.com/iij/mruby-aws-s3.git'
end
MRuby::Build.new('host-debug') do |conf|
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
enable_debug
conf.gembox 'default'
conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
conf.gem :core => "mruby-bin-debugger"
end
MRuby::Build.new('test') do |conf|
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
enable_debug
conf.enable_bintest
conf.enable_test
conf.gembox 'default'
end
我发现const_get
方法在红宝石中与mruby不同。在ruby(2.4.0p0)中,Class.const_get('Fixnum')
返回常量Fixnum
,而在mruby Class.const_get('Fixnum')
中会返回错误uninitialized constant Class::Fixnum (NameError)
。
然后,我尝试了另一个例子:class Hoge; end; class Hoge::Fuga; end
。在ruby中,Class.const_get('Hoge::Fuga')
和Hoge.const_get('Fuga')
都会给出常量Hoge::Fuga
。在mruby中,只有Hoge.const_get('Fuga')
返回Hoge::Fuga
。
答案 0 :(得分:0)
mruby的inherit
就像第二个参数(在{名} false
中搜索超类){J}中的Object.const_get(:Integer)
一样。
如果你使用DECLARE @Student TABLE(StudentId CHAR(1), SubCode VARCHAR(2),SubName VARCHAR(10))
INSERT INTO @Student VALUES('1','M1','Math')
INSERT INTO @Student VALUES('1','S1','Science')
INSERT INTO @Student VALUES('1','E1','English')
INSERT INTO @Student VALUES('2','H1','History')
INSERT INTO @Student VALUES('2','G2','Geography')
INSERT INTO @Student VALUES('4','M1','Math')
SELECT CASE WHEN D.RN=1 THEN D.StudentId ELSE '' END StudentId
,D.SubCode,D.SubName
FROM(
SELECT *
,ROW_NUMBER() OVER(PARTITION BY StudentId ORDER BY StudentId)RN
FROM @Student
)D
ORDER BY
D.StudentID, D.RN
,它的行为应该与你在mruby和CRuby中的预期相同。