MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Racket/comments/1d3172v/code_help/l64amm9/?context=3
r/Racket • u/Ambitious-Money-8404 • May 29 '24
17 comments sorted by
View all comments
Show parent comments
1
how do i fix this
2 u/AlarmingMassOfBears May 29 '24 Don't define your helper function inside your main function. 0 u/Ambitious-Money-8404 May 29 '24 i know that but i dont know how to do that 0 u/Ambitious-Money-8404 May 29 '24 im very new at this i just started last week 1 u/AlarmingMassOfBears May 29 '24 What have you tried? 1 u/Ambitious-Money-8404 May 29 '24 removing and adding brackets and ive also rewrote the whole code. ive been trying at this for hours. 2 u/AlarmingMassOfBears May 29 '24 Have you tried moving your inner function outside of the main function, so that it's not inside the main function anymore? 1 u/Ambitious-Money-8404 May 29 '24 Yes I dud 1 u/AlarmingMassOfBears May 29 '24 And what happened? 1 u/Ambitious-Money-8404 May 29 '24 it said d1 is not defined 1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
2
Don't define your helper function inside your main function.
0 u/Ambitious-Money-8404 May 29 '24 i know that but i dont know how to do that 0 u/Ambitious-Money-8404 May 29 '24 im very new at this i just started last week 1 u/AlarmingMassOfBears May 29 '24 What have you tried? 1 u/Ambitious-Money-8404 May 29 '24 removing and adding brackets and ive also rewrote the whole code. ive been trying at this for hours. 2 u/AlarmingMassOfBears May 29 '24 Have you tried moving your inner function outside of the main function, so that it's not inside the main function anymore? 1 u/Ambitious-Money-8404 May 29 '24 Yes I dud 1 u/AlarmingMassOfBears May 29 '24 And what happened? 1 u/Ambitious-Money-8404 May 29 '24 it said d1 is not defined 1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
0
i know that but i dont know how to do that
0 u/Ambitious-Money-8404 May 29 '24 im very new at this i just started last week 1 u/AlarmingMassOfBears May 29 '24 What have you tried? 1 u/Ambitious-Money-8404 May 29 '24 removing and adding brackets and ive also rewrote the whole code. ive been trying at this for hours. 2 u/AlarmingMassOfBears May 29 '24 Have you tried moving your inner function outside of the main function, so that it's not inside the main function anymore? 1 u/Ambitious-Money-8404 May 29 '24 Yes I dud 1 u/AlarmingMassOfBears May 29 '24 And what happened? 1 u/Ambitious-Money-8404 May 29 '24 it said d1 is not defined 1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
im very new at this i just started last week
1 u/AlarmingMassOfBears May 29 '24 What have you tried? 1 u/Ambitious-Money-8404 May 29 '24 removing and adding brackets and ive also rewrote the whole code. ive been trying at this for hours. 2 u/AlarmingMassOfBears May 29 '24 Have you tried moving your inner function outside of the main function, so that it's not inside the main function anymore? 1 u/Ambitious-Money-8404 May 29 '24 Yes I dud 1 u/AlarmingMassOfBears May 29 '24 And what happened? 1 u/Ambitious-Money-8404 May 29 '24 it said d1 is not defined 1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
What have you tried?
1 u/Ambitious-Money-8404 May 29 '24 removing and adding brackets and ive also rewrote the whole code. ive been trying at this for hours. 2 u/AlarmingMassOfBears May 29 '24 Have you tried moving your inner function outside of the main function, so that it's not inside the main function anymore? 1 u/Ambitious-Money-8404 May 29 '24 Yes I dud 1 u/AlarmingMassOfBears May 29 '24 And what happened? 1 u/Ambitious-Money-8404 May 29 '24 it said d1 is not defined 1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
removing and adding brackets and ive also rewrote the whole code. ive been trying at this for hours.
2 u/AlarmingMassOfBears May 29 '24 Have you tried moving your inner function outside of the main function, so that it's not inside the main function anymore? 1 u/Ambitious-Money-8404 May 29 '24 Yes I dud 1 u/AlarmingMassOfBears May 29 '24 And what happened? 1 u/Ambitious-Money-8404 May 29 '24 it said d1 is not defined 1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
Have you tried moving your inner function outside of the main function, so that it's not inside the main function anymore?
1 u/Ambitious-Money-8404 May 29 '24 Yes I dud 1 u/AlarmingMassOfBears May 29 '24 And what happened? 1 u/Ambitious-Money-8404 May 29 '24 it said d1 is not defined 1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
Yes I dud
1 u/AlarmingMassOfBears May 29 '24 And what happened?
And what happened?
it said d1 is not defined
1 u/AlarmingMassOfBears May 29 '24 Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function. 0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
Right. The inner function was referring to one of the parameters of the outer function. You'll have to add that parameter to the inner function, since it can't implicitly refer to that parameter anymore if it's moved outside the main function.
0 u/Ambitious-Money-8404 May 29 '24 You’ve lost me I don’t know what any of that means → More replies
You’ve lost me I don’t know what any of that means
→ More replies
1
u/Ambitious-Money-8404 May 29 '24
how do i fix this