Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

We cant name a function 'print'?

Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
11-03-2004 00:17
Anyone ever noticed that if you make a script with a function named 'print' it wont compile?
Since when has 'print' been a reserved word in LSL? And why?
I reported it as a bug but no one ever got back to me.
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
11-03-2004 07:54
Hahaha... I'm seeing piles of paper next to the printer in SL serverland!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
11-03-2004 10:11
From: Eggy Lippmann
Anyone ever noticed that if you make a script with a function named 'print' it wont compile?
Since when has 'print' been a reserved word in LSL? And why?
I reported it as a bug but no one ever got back to me.


They haven't gotten back to me on any bugs in about two, maybe three weeks (at least). LL seems to have dropped off the face of the earth.

From: Samhain Broom
Hahaha... I'm seeing piles of paper next to the printer in SL serverland!


*snerk*
_____________________
</sarcasm>
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
11-03-2004 13:00
Mole,
Preview bug reports or main grid?

UU
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
11-03-2004 13:30
From: Upshaw Underhill
Mole,
Preview bug reports or main grid?

UU


Both.
_____________________
</sarcasm>
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-03-2004 15:06
well 1.5.5 had less cleaning done then previous releases have had done; viewerart.ini has keys to test trees in it.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-29-2010 12:32
NECROPOST!!

Somebody over in FlogAnswers just asked about what 'print' does in LSL and I stumbled over this old post..

It seems to be an event/callback but I don't see any docs on it. Anybody know?

edit: https://blogs.secondlife.com/message/75398
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-29-2010 12:49
Well since "Hi" compiles too without print(), (see my title) I woudln't have too much hopes.

It returns a key/string which is equal to NULL_KEY, but that doesn't work with Mono, only old LSL.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-29-2010 18:49
that is an odd bit of code... the word print should be generating a compile error, but I guess that it's part of the functions naming... I know at one point it was possible to name functions to the same name as the internal event calls (which are compiled as functions) and actually directly call events as a user function... this may just be more of that exposed...
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
01-29-2010 18:54
Eggy, Moleculor, a blast from the past.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-29-2010 19:08
I know huh... I miss Eggy
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-31-2010 20:54
Good friends, old friends :(

I forgot this thread existed, even posting to it. Wish I had remembered when the article on the LSL Portal was written (would have saved me a bit of face). Should checkout the example I wrote for it (I'm bad :p)

https://wiki.secondlife.com/wiki/Print

Oh and "print" support was almost dropped in Mono, but I found out and "saved" it. :D

http://jira.secondlife.com/browse/SVC-1499
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-31-2010 20:57
Oh and "print" support was almost dropped in Mono, but I found it and "saved" it. :D

http://jira.secondlife.com/browse/SVC-1499
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
02-01-2010 07:56

Oops.. Somehow missed finding that one..

Do we know where stdout actuall goes? Hopefully not to a log file on the sim.

edit: and how do/did you know it went to stdout? Was that from a guess or from inside info? :)
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
02-01-2010 08:25
Erk, sounds like you could DOS a server with this baby if it actually works.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-01-2010 09:51
In my insanity I think it'd be amusing to send notes to LL with this...

"Hi, I R in your server, spamming your logs"
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
02-05-2010 15:50
Unlike the ll* functions for which we do not have the source code for, we do have the source code for the rest of the VM and compiler. As it turns out "print" is not a function but actually a bytecode (in LSO) and it's implementation can be found in the viewer source.

When it was pointed out to me that "print" was a compiler token, I started walking the compiler source looking at what it did. I too was surprised by the implementation.

printf to the rescue :D

http://svn.secondlife.com/trac/linden/browser/trunk/indra/lscript/lscript_execute/lscript_execute.cpp#L3908
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
02-05-2010 16:05
As to the mono implemenation, I cannot speak.

All I can say is that it first casts the argument to a string, and then sends the result off to:
[LslLibrary]LindenLab.SecondLife.Library::Print(string)

I've never seen the source for "LindenLab.SecondLife.Library"... I'd like to.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-05-2010 16:24
wonder if it's redirected to a file...
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
02-08-2010 18:09
From: Void Singer
wonder if it's redirected to a file...

It would be pretty pointless otherwise.

What I wonder is if all messages produced by the simulator go to the same log file. If they do you could use "print" to forge log messages. I wouldn't be surprised if there are several services that watch the log files for certain events (like why did the simulator crash). Without insider information you wouldn't be able to know but if you did have said information you might be able to crash or own the service. In the latter case you could open up a hell mouth and let demons take over the world.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-09-2010 06:54
lol I only mentioned it because stdout is usually the screen (well text terminal, but for general purposes... yeah)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -