Post Reply 
[SOLVED] LNAME - exctracting variables from stringed expression?
01-16-2017, 02:46 PM
Post: #5
RE: [SOLVED] LNAME - exctracting variables from stringed expression?
(01-16-2017 11:41 AM)DrD Wrote:  Summary:

1. LNAME is shown in the [Toolbox] and command entry, as a Home command, and shown in the [Help] as a CAS command.

2. LNAME requires non-reserved variables, (symbolics only).

3. Possibly one way to get non-reserved variables is to shift them to lower case equivalents. They must not pre-exist, only symbolic.

4. An LNAME acceptable string argument can get "evaluated" in the CAS system using the CAS command.


#1: I wonder if this is incomplete documentation. There are two commands: lname and LNAME that do similar things. In Home view, you need to provide an unevaluated expression to LNAME.

#2: LNAME can return any type of variable: non-reserved, reserved, even app names and local names from within programs.

#3: Pre-existing variables are fine. Use a quoted expression to force non-evaluation. LNAME('X+Y') will return { X, Y } in the Home screen. Typing in LNAME('X+Y') vs lname('X+Y') in the CAS view will net different results (probably due to differences in how each view passes parameters to the other view; or it could simply be a bug). Generally speaking, use uppercase in Home view and lowercase in CAS view for command names.

#4: Not "can" but "will" -- this is a guaranteed behavior. I am unaware of any instance in which this is not the case, but I have been wrong on many occasions (and quite possibly more often than not when it comes to the CAS). The CAS() command takes as its argument the content of the string and always evaluates the content. Evaluating CAS("x+2*y-3") is the same as literally typing x+2*y-3 in the command line while in CAS view (and the command line necessarily evaluates what was entered). To get an unevaluated expression, quote the content: CAS(" 'x+2*y-3' "). Quoted expressions are still evaluated -- effectively, their quotes are stripped.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: [SOLVED] LNAME - exctracting variables from stringed expression? - Han - 01-16-2017 02:46 PM

User(s) browsing this thread: 1 Guest(s)