V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
wuyinyin
V2EX  ›  程序员

其实想用 function 表达的是一句诗,但不知道是否规范,求指正,如何才能更美?

  •  
  •   wuyinyin · Oct 14, 2015 · 2681 views
    This topic created in 3852 days ago, the information mentioned may be changed or developed.

    if (TRIP_BEGIN)
    {
    hope();
    }
    function hope()
    {
    道路漫长﹐充满奇迹﹐充满发现
    }

    hahasong
        1
    hahasong  
       Oct 14, 2015
    pseudocode
    XianZaiZhuCe
        2
    XianZaiZhuCe  
       Oct 14, 2015
    你这代码是给人看的还是给程序看的?
    htfy96
        3
    htfy96  
       Oct 14, 2015
    ruby:

    def trip
    yield "道路漫长﹐充满奇迹﹐充满发现"
    end

    begin trip do |hope|
    puts hope
    end
    end
    wuyinyin
        4
    wuyinyin  
    OP
       Oct 15, 2015
    @htfy96 多谢少年
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2467 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:32 · PVG 17:32 · LAX 02:32 · JFK 05:32
    ♥ Do have faith in what you're doing.