Sha256: c31a3297fddef3b0d5c93d5c8f7cbbe79bcbd33214e15c533e65a41991877112

Contents?: true

Size: 423 Bytes

Versions: 8

Compression:

Stored size: 423 Bytes

Contents

module Qlang
  module Api
    module VectorApi
      def execute(nums)
        case $meta_info.lang
        when :r
          "c(#{nums.join(', ')})"
        when :ruby
          "Vector[#{nums.join(', ')}]"
        when :python
          "array([#{nums.join(', ')}])"
        else
          fail "Vector is not implemented for #{$meta_info.lang_str}"
        end
      end
      module_function :execute
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
hilbert-0.0.2700000 lib/qlang/api/vector_api.rb
qlang-0.0.27182124 lib/qlang/api/vector_api.rb
qlang-0.0.27182123 lib/qlang/api/vector_api.rb
qlang-0.0.27182122 lib/qlang/api/vector_api.rb
qlang-0.0.27182121 lib/qlang/api/vector_api.rb
qlang-0.0.27182120 lib/qlang/api/vector_api.rb
qlang-0.0.27182110 lib/qlang/api/vector_api.rb
qlang-0.0.27182100 lib/qlang/api/vector_api.rb