Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 150415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:17:13+00:00 2026-05-11T09:17:13+00:00

temp = 98.3 begin print Your temperature is + temp.to_s + Fahrenheit. puts I

  • 0
temp = 98.3 begin   print 'Your temperature is ' + temp.to_s + ' Fahrenheit. '   puts 'I think you're okay.'   temp += 0.1 end while temp < 98.6 

In the above example, is everything between begin and end a block?

I’m still confused what a block is.

If you can’t call it a block, what would you call that chunk of code between begin and end? Is it ok to call it a chunk?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:17:14+00:00Added an answer on May 11, 2026 at 9:17 am

    Block has a special meaning in Ruby. According to Matz, Ruby’s creator, you can look at a block as a nameless function – typically something that can be yielded into, and which may also take parameters.

    You may see the following kind of disamiguation when describing Ruby syntax:

    • begin…end (what is called block in other languages) may sometimes be referred to simply as what it is, i.e. an expression (which may in turn contain other expressions – an expression is simply something that has a return value) in Ruby. Some references will still call it a begin/end block, or a code block, adding somewhat to the confusion
    • do…end or {...} will always be referred to as a block in Ruby

    For examples, peruse the the Ruby syntax man page, e.g.

    begin expression end
    expression while expression
    loop block

    For further reading, see:

    • Programming Ruby
    • Ruby (from other languages)
    • Much, much more documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to come up with a simple example of a while loop using
I discuss the Exception Safety Guaratees and devised an example that I think provides
class Temp { private: ~Temp() {} friend class Final; }; class Final : virtual
Application[temp] = 8; should set the value 8 to the key temp . However,
string temp is equal to ZERO:\t.WORD\t1 from my debugger. (the first line of my
I have a temp table with the exact structure of a concrete table T
I have a file temp.txt, that I want to sort with the sort command
I need to remove temp files on Tomcat startup, the pass to a folder
Oracle FAQ defines temp table space as follows: Temporary tablespaces are used to manage
I am using temp data as follow in my controllers - very simple, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.