Author Topic: OT Basic  (Read 74024 times)

0 Members and 2 Guests are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OT Basic
« Reply #60 on: March 16, 2011, 09:53:17 pm »
There will definitely need to be a char() command so that users can have access to all of the ASCII characters and this will allow for something like this to concatenate strings (like on the 89):
Code: [Select]
"Hello "&"World"&char(33

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: OT Basic
« Reply #61 on: March 17, 2011, 09:05:04 pm »
I agree, too. This would also essentially allow digit to string conversion, if say char(62) corresponds to 1 then char(61+x) corresponds to x. But, number to string conversion would still have to be added separately.
« Last Edit: March 17, 2011, 09:05:13 pm by program4 »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OT Basic
« Reply #62 on: March 17, 2011, 09:33:26 pm »
Well it isn't very difficult in assembly, it just requires writing a byte.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: OT Basic
« Reply #63 on: March 19, 2011, 11:06:40 pm »
Maybe the ability to add quotation marks to a string would be nice, like using escape code or whatever it's called. Like, the " symbol means you type
Code: [Select]
/" and the / symbol means you type
Code: [Select]
// just like in Java. This would also allow for escape sequences like newline
Code: [Select]
/n

I'd actually suggest a backslash (\) instead. It's what languages like Java use, and using / could get messy when users want the division sign -- which could happen a lot on a calculator ;)




Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: OT Basic
« Reply #64 on: March 20, 2011, 01:48:15 pm »
Maybe the ability to add quotation marks to a string would be nice, like using escape code or whatever it's called. Like, the " symbol means you type
Code: [Select]
/" and the / symbol means you type
Code: [Select]
// just like in Java. This would also allow for escape sequences like newline
Code: [Select]
/n

I'd actually suggest a backslash (\) instead. It's what languages like Java use, and using / could get messy when users want the division sign -- which could happen a lot on a calculator ;)
yeah, backslash definitely should be used.

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: OT Basic
« Reply #65 on: March 20, 2011, 09:13:26 pm »
Oh oops, it looks like I forgot my Java.  :-[

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: OT Basic
« Reply #66 on: March 20, 2011, 09:25:18 pm »
I agree, too. This would also essentially allow digit to string conversion, if say char(62) corresponds to 1 then char(61+x) corresponds to x. But, number to string conversion would still have to be added separately.

I'd recommend going with hex and standard ASCII. That'd mean that char(31) would return "1" and char(62) would return "b." It'd also make things like char(546869732069732066756e) really easy to parse if they were in hex rather than decimal.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OT Basic
« Reply #67 on: March 20, 2011, 09:33:38 pm »
I agree and I also think that to keep data smaller, the program should undergo a "tokenization" process like with the TI-89. This way, data can be converted directly to bytes that the parser can work with.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: OT Basic
« Reply #68 on: March 20, 2011, 09:34:15 pm »
I agree, too. This would also essentially allow digit to string conversion, if say char(62) corresponds to 1 then char(61+x) corresponds to x. But, number to string conversion would still have to be added separately.

I'd recommend going with hex and standard ASCII. That'd mean that char(31) would return "1" and char(62) would return "b." It'd also make things like char(546869732069732066756e) really easy to parse if they were in hex rather than decimal.
agreed.  In fact, I like that a lot better.  But I like char(596F752772652072696768742C2074686973206973206C6F616473206F662066756E2E) better.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: OT Basic
« Reply #69 on: March 21, 2011, 10:49:23 am »
I agree, too. This would also essentially allow digit to string conversion, if say char(62) corresponds to 1 then char(61+x) corresponds to x. But, number to string conversion would still have to be added separately.

I'd recommend going with hex and standard ASCII. That'd mean that char(31) would return "1" and char(62) would return "b." It'd also make things like char(546869732069732066756e) really easy to parse if they were in hex rather than decimal.

I don't like the idea of having numbers be treated fundamentally as hex. It's bad for UI to say that the 62 in char(62) is hex, while the 62 in floor(62) is decimal.




Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: OT Basic
« Reply #70 on: March 21, 2011, 12:00:16 pm »
true.  Maybe a lowercase b/h?  or %/$?

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: OT Basic
« Reply #71 on: March 21, 2011, 12:30:50 pm »
true.  Maybe a lowercase b/h?  or %/$?

I think %/$ would be a good idea. They're hardly used in other situations.

Unless we want to make them actual operators? :D

EDIT: Btw, who's actually working on this?
« Last Edit: March 21, 2011, 12:31:04 pm by Deep Thought »




Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: OT Basic
« Reply #72 on: March 21, 2011, 12:39:46 pm »
true.  Maybe a lowercase b/h?  or %/$?

I think %/$ would be a good idea. They're hardly used in other situations.

Unless we want to make them actual operators? :D

EDIT: Btw, who's actually working on this?
We don't actually have a physical calc yet, so it's mostly conceptual atm.

Ashbad

  • Guest
Re: OT Basic
« Reply #73 on: March 21, 2011, 01:49:35 pm »
I acutally like the idea of using hex for a char() command.  That's actually how most people denote chars.  If you want to make a decimal version, I suggest a Byte() or RShort() command.

Also, I suggest an optinional approach of OOP -- like C++.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: OT Basic
« Reply #74 on: March 21, 2011, 01:55:45 pm »
I acutally like the idea of using hex for a char() command.  That's actually how most people denote chars.  If you want to make a decimal version, I suggest a Byte() or RShort() command.

People don't like inconsistency though. Plus if we don't make an exception for char( and instead let it take a value the same way as any other command, the OS code for it would be much, much smaller.

EDIT: We can always have a format for hex numbers, as graphmastur said.
« Last Edit: March 21, 2011, 01:56:21 pm by Deep Thought »