Variable automatically created which should be a recognised JME function

8 views
Skip to first unread message

Julia Goedecke

unread,
Apr 28, 2022, 7:15:02 AM4/28/22
to Numbas Users
Hello,
I think this error has happened before:
I'm creating a question
https://numbas.mathcentre.ac.uk/question/share/view/996c17fe-29f9-48bb-ae37-292dfdefe762
where I have a function definition which uses "sum(..)", sum of a list
of numbers, which is a JME function, right? But then there variable
"sum" is automatically created as the editor thinks I need it.

Julia
--
www.julia-goedecke.de

Ben Brawn

unread,
Apr 28, 2022, 7:28:43 AM4/28/22
to numbas...@googlegroups.com
try changing your definition to map(v[i]*w[i],i,0..len(v)-1)

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/e152e59f-c90e-dff6-524d-27c5a71131f7%40cantab.net.

Julia Goedecke

unread,
Apr 28, 2022, 7:38:41 AM4/28/22
to numbas...@googlegroups.com
That's not the problem, it still creates the "sum" variable.

I've solved it in a different way for this question but I think it's an
error in how the editor creates variables that it thinks should be there.

Julia

On 28.04.22 13:28, Ben Brawn wrote:
> try changing your definition to map(v[i]*w[i],i,0..len(v)-1)
>
> On Thu, 28 Apr 2022 at 21:15, Julia Goedecke <julia.g...@cantab.net
> <mailto:julia.g...@cantab.net>> wrote:
>
> Hello,
> I think this error has happened before:
> I'm creating a question
> https://numbas.mathcentre.ac.uk/question/share/view/996c17fe-29f9-48bb-ae37-292dfdefe762
> <https://numbas.mathcentre.ac.uk/question/share/view/996c17fe-29f9-48bb-ae37-292dfdefe762>
> where I have a function definition which uses "sum(..)", sum of a list
> of numbers, which is a JME function, right? But then there variable
> "sum" is automatically created as the editor thinks I need it.
>
> Julia
> --
> www.julia-goedecke.de <http://www.julia-goedecke.de>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Numbas Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to numbas-users...@googlegroups.com
> <mailto:numbas-users%2Bunsu...@googlegroups.com>.
> <https://groups.google.com/d/msgid/numbas-users/e152e59f-c90e-dff6-524d-27c5a71131f7%40cantab.net>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Numbas Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to numbas-users...@googlegroups.com
> <mailto:numbas-users...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/numbas-users/CABW86oJBDz1KeWSwG4SyeKXEBfSxtAnELE2EuFHCJWFhJzSwyQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/numbas-users/CABW86oJBDz1KeWSwG4SyeKXEBfSxtAnELE2EuFHCJWFhJzSwyQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Christian Lawson-Perfect

unread,
Apr 28, 2022, 7:38:45 AM4/28/22
to numbas...@googlegroups.com
The 'sum' variable that's there doesn't claim to be used anywhere, so I think what happened is that it was created while you were typing, before you put the brackets in to make it a function application, and then somehow it forgot to remove it. I made a copy of your question and deleted the variable, and it wasn't created again.

Julia Goedecke

unread,
Apr 28, 2022, 7:41:32 AM4/28/22
to numbas...@googlegroups.com
How odd! I did try removing in the original question but it kept coming
back. Thanks!

Julia

On 28.04.22 13:38, Christian Lawson-Perfect wrote:
> The 'sum' variable that's there doesn't claim to be used anywhere, so I
> think what happened is that it was created while you were typing, before
> you put the brackets in to make it a function application, and then
> somehow it forgot to remove it. I made a copy of your question and
> deleted the variable, and it wasn't created again.
>
> On Thu, 28 Apr 2022 at 12:28, Ben Brawn <ben....@gmail.com
> <mailto:ben....@gmail.com>> wrote:
>
> try changing your definition to map(v[i]*w[i],i,0..len(v)-1)
>
> On Thu, 28 Apr 2022 at 21:15, Julia Goedecke
> <julia.g...@cantab.net <mailto:julia.g...@cantab.net>> wrote:
>
> Hello,
> I think this error has happened before:
> I'm creating a question
> https://numbas.mathcentre.ac.uk/question/share/view/996c17fe-29f9-48bb-ae37-292dfdefe762
> <https://numbas.mathcentre.ac.uk/question/share/view/996c17fe-29f9-48bb-ae37-292dfdefe762>
> where I have a function definition which uses "sum(..)", sum of
> a list
> of numbers, which is a JME function, right? But then there variable
> "sum" is automatically created as the editor thinks I need it.
>
> Julia
> --
> www.julia-goedecke.de <http://www.julia-goedecke.de>
>
> --
> You received this message because you are subscribed to the
> Google Groups "Numbas Users" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to numbas-users...@googlegroups.com
> <mailto:numbas-users%2Bunsu...@googlegroups.com>.
> <https://groups.google.com/d/msgid/numbas-users/e152e59f-c90e-dff6-524d-27c5a71131f7%40cantab.net>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Numbas Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to numbas-users...@googlegroups.com
> <mailto:numbas-users...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/numbas-users/CABW86oJBDz1KeWSwG4SyeKXEBfSxtAnELE2EuFHCJWFhJzSwyQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/numbas-users/CABW86oJBDz1KeWSwG4SyeKXEBfSxtAnELE2EuFHCJWFhJzSwyQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Numbas Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to numbas-users...@googlegroups.com
> <mailto:numbas-users...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/numbas-users/CAEMHSOiVcYUQE_GpUv9CYAZOu97nyZ1yJTftOwmbjkiVxZPMqA%40mail.gmail.com
> <https://groups.google.com/d/msgid/numbas-users/CAEMHSOiVcYUQE_GpUv9CYAZOu97nyZ1yJTftOwmbjkiVxZPMqA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages