Future request/question

Pixilang programming language
Post Reply
philipbergwerf
Posts: 132
Joined: Sat Mar 17, 2018 4:23 pm

Future request/question

Post by philipbergwerf »

I now I have a little experience in pixilang but I really want an easy way to see the outcome of a variable. Why can't there be a simple built-in function

Code: Select all

print(object)
that prints the containing object if possible?

The problem/discomfort is that you have to type a lot and think about the type of data if you want to quickly report to stdout what your object is doing during a while loop.

example:

Code: Select all

i = 0
var = 15
example = 1
while i < 100
{
    example * var
    i + 1
    printf("%f\n", example)
}
What I want is:

Code: Select all

i = 0
var = 15
example = 1
while i < 100
{
    example * var
    i + 1
    print(example)
}
print recognizes the type of data automaticly and returns the value to stdout? I am curious why specifying the type in printf is valuable.
philipbergwerf
Posts: 132
Joined: Sat Mar 17, 2018 4:23 pm

Re: Future request/question

Post by philipbergwerf »

Ah I see there is already a print() function :oops:
User avatar
NightRadio
Site Admin
Posts: 3550
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Future request/question

Post by NightRadio »

The problem is that there is only numeric data type in Pixilang :)
Even if you write something like:
str = "some text"
str is a numeric variable, which contain the ID of the string container.
So there is no automatic way to determine what str is (container id or just a number)
philipbergwerf
Posts: 132
Joined: Sat Mar 17, 2018 4:23 pm

Re: Future request/question

Post by philipbergwerf »

Ah I understand. And I can add some snippets to my text editor to overcome the discomfort :)
Post Reply