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 892971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:08:46+00:00 2026-05-15T14:08:46+00:00

When typing in rebol console do read http://askcodegeneration.com/csharp/simple-class/ I get get-access-modifier called twice: Access

  • 0

When typing in rebol console

do read http://askcodegeneration.com/csharp/simple-class/

I get get-access-modifier called twice:

Access modifier:
1. private: member can be accessed only by code in the same class
2. protected: member can be accessed only by code in the same class or in a derived  class
3. internal: member can be accessed only by code in the same assembly
4. public: member can be accessed by code in the same assembly or another assembly that references it choice (by default 1): 
Access modifier:
1. private: member can be accessed only by code in the same class
2. protected: member can be accessed only by code in the same class or in a derived  class
3. internal: member can be accessed only by code in the same assembly
4. public: member can be accessed by code in the same assembly or another assembly that references it choice (by default 1):

Whereas it is only mentioned once in the source code:

append fields-template-output form reduce [
    (to-word get-access-modifier) field-layout
]

I really can’t see why, can you ?

Original code here (Internet Archive)

  • 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. Editorial Team
    Editorial Team
    2026-05-15T14:08:46+00:00Added an answer on May 15, 2026 at 2:08 pm

    Yes. There is only one call to it, but it’s inside of a foreach. Your default is two fields, so you get asked twice. Enter more, you’ll get asked more.

    While you could (and probably should) do the obvious thing of saving it in a variable, Rebol has other ways. For instance you could compose the block of code:

    foreach field-layout fields-layout COMPOSE/DEEP [
        append fields-template-output  "        "
        append fields-template-output  form reduce [
            to-word (get-access-modifier) field-layout
        ]
        append fields-template-output  ";"
        append fields-template-output  newline
    ]
    

    The composition runs once, looks deep for the parentheses in the block, and evaluates the code. (Kind of how parse does when it sees parentheses). The rest is left alone. So the block with the substitutions done is what’s passed into FOREACH to run the loop.

    Just a nuance of how you could have a call that appears to be inside a loop and yet is executed only once. I wouldn’t suggest using it for something like this.

    What I would suggest is studying making things less redundant in your code, by learning some more Rebol primitives like REJOIN…which builds a series out of a block. The series type will match whatever the first type it sees is (or a string if the first element is not a series):

    modifier: get-access-modifier ;-- called only once, stored in variable
    
    foreach field-layout fields-layout [
        append fields-template-output rejoin [
            "        "
            (to-string modifier)
            field-layout
            ";"
            newline
        ]
    ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer ok I got it working bit of a doh! moment.… May 16, 2026 at 1:57 pm
  • Editorial Team
    Editorial Team added an answer There's some explanation and pseudo-code of implementation on Wikipedia May 16, 2026 at 1:57 pm
  • Editorial Team
    Editorial Team added an answer public delegate IOrderedEnumerable<TSource> OrderByFunc<TSource, TKey>( IEnumerable<TSource> source, Func<TSource, TKey> keySelector);… May 16, 2026 at 1:57 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Typing Ctrl+O twice in editor when a java type is selected pops-up an outline
Typing in programs longer than 50 characters got old really fast on my HP49g+.
Typing out the title to this leads me to believe this might not be
Typing on iPhone is tedious; I'd like to prompt my users for their email
When typing code in a .aspx file (an MVC view in this case), Visual
When typing code, I would normally close brackets, go back inside, go outside, type
while typing in Xcode, (objective - c for iPhone dev) Suppose I write [mySprite
When typing in my URL SalaryFor/Microsoft/Balmer i need to display salary for user with
When typing into a CRichEditCtrl, EN_CHANGE messages are generated. However MSDN says: Rich Edit:
When I start typing a try/catch block, ReSharper causes it to be expanded from

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.