Coder Social home page Coder Social logo

rickychilcott / crystal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crystal-lang/crystal

0.0 0.0 0.0 37.29 MB

The Crystal Programming Language

Home Page: https://crystal-lang.org

License: Other

Makefile 0.07% Shell 0.23% Crystal 98.15% HTML 0.35% CSS 0.19% JavaScript 0.77% C 0.01% C++ 0.24%

crystal's Introduction

Hi ๐Ÿ‘‹, I'm Ricky

I live in Southeast Ohio, believe in full-stack dev, and love me some Rails.

  • ๐Ÿ”ญ Iโ€™m currently working on Mission Met and focus much of my efforts on Causey

  • ๐Ÿ’ฌ Ask me about rails, stimulus, ruby, me

  • โšก Fun fact I only know how to tell dad jokes.

Connect with me:

rickychilcott rickychilcott

Languages and Tools:

java postgresql ruby

ย rickychilcott

rickychilcott

crystal's People

Contributors

adlerhsieh avatar akzhan avatar asterite avatar bcardiff avatar bew avatar bjmllr avatar davydovanton avatar jacobub avatar jhass avatar kostya avatar lbguilherme avatar luislavena avatar makenowjust avatar matiasgarciaisaia avatar oprypin avatar papamarkou avatar pragtob avatar rhysd avatar rx14 avatar sija avatar straight-shoota avatar technorama avatar vegai avatar waj avatar waterlink avatar will avatar wooster0 avatar ysbaddaden avatar yui-knk avatar zamith avatar

Watchers

 avatar  avatar

crystal's Issues

Calling a referenced proc, in a macro contained within a namespaced class

I was able to find an issue that crops up when you are building a macro that references a method, as a proc, and tries to call in that context. When it's wrapped in a module it's broken, but when it's not wrapped in a module it's fine.

module TestMod
  class TestClass
    def self.test_method
      puts "Do something"
    end

    macro build_proc_method(name)
      def self.{{name}}_as_proc
        ->self.{{name}}.call
      end
    end

    build_proc_method(test_method)
  end
end

TestMod::TestClass.test_method_as_proc

I get the following error message:

Syntax error in expanded macro: build_proc_method:2: unexpected token: .

        ->self.test_method.call

When it's not wrapped in a module, everything works as expected. For instance:

class TestClass
  def self.test_method
    puts "Do something"
  end

  macro build_proc_method(name)
    def self.{{name}}_as_proc
      ->self.{{name}}.call
    end
  end

  build_proc_method(test_method)
end

TestClass.test_method_as_proc

Crystal 0.26.1 (2018-08-27)
LLVM: 6.0.1
Default target: x86_64-apple-macosx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.