[comp.sys.handhelds] Questions Regarding Lists & The Solver

kenr@peabody.iusb.indiana.edu (Ken Rawlings) (02/19/91)

I have a few questions that have been bugging me for a while:

#1: It is possible to specify a custom menu in the solver(and the MES for
that matter). However, I can not seem to be able to get "NXEQ" to work as
a menu option. I belive this is related to the fact that NXEQ is part of
the solver program and not a general program. Also, I cannot seem to make
more that one custom menu per EQ. I have my EQ as a list of equations, and
everything will work fine if there is ONE custom menu list at the end of
EQ. However, if I try to put more that one custom menu _anywhere_ in the
EQ list, I get an error message. 

#2: What is the easies way to subtract an atom from a list. i.e.

		{ FOO BAR NETA }
	      - { NETA }
              ------------------
	      = { FOO BAR}	

	Or even better:

		{ FOO BAR NETA }
	      - { NETA FOO }
	      ------------------
	      = { BAR }	

I realize I could write a subroutine to do this, but it seems like such a 
common thing to do that it must already be built in somewhere.

	If the answers to either of these questions lies in the manual,
please direct me, I have been trying to figure out both of these things for
a while.

				Ken Rawlings


-------------------------------------------------------------------------------
 Ken Rawlings / kenr@peabody.iusb.indiana.edu / Indiana University, South Bend
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
 Ken Rawlings / kenr@peabody.iusb.indiana.edu / Indiana University, South Bend
-------------------------------------------------------------------------------

edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) (02/19/91)

In article <1991Feb19.080133.24204@bronze.ucs.indiana.edu>,
kenr@peabody.iusb.indiana.edu (Ken Rawlings) writes:

>#1: It is possible to specify a custom menu in the solver(and the MES for
>that matter). However, I can not seem to be able to get "NXEQ" to work as
>a menu option.

All I can suggest is that you write a program to perform the NXEQ and include
that program in the custom menu, with the label "NXEQ".

You also mentioned putting several menus into an EQ list.  I don't think that is
supported.

>#2: What is the easiest way to subtract an atom from a list. i.e. . . .
>I realize I could write a subroutine to do this, but it seems like such a 
>common thing to do that it must already be built in somewhere.

I don't think this one is built in.


				-- edp (Eric Postpischil)
				"Always mount a scratch monkey."
				edp@jareth.enet.dec.com

sburke@jarthur.Claremont.EDU (Scott Burke) (02/20/91)

Jim Donnelly's Toolkit contains a few words that are useful when it comes
to extracting atoms from lists.  Atoms?  You must be a LISPer.  Anyways...

DIFF takes { A B C } { B } and returns { A C }
     takes { 1 2 3 4 } { 5 6 } and returns { 1 2 3 4 }
     takes { 1 2 3 4 } { 3 4 5 } and returns { 1 2 }

SDIFF takes { 1 2 3 4 } { 5 6 } and returns { 1 2 3 4 5 6 }
      takes { 1 2 3 4 } { 3 4 5 } and returns { 1 2 5 }

(SDIFF is the set symmetric difference; DIFF merely the set difference)

Other useful set commands in the Toolkit are:

  ADJOIN:  Adds an object to a list if it is unique
  INTERSECT:  Returns the set intersection between two lists
  \->SET:  Removes duplicate objects from a list
  UNION:  Returns the set union of two lists

The Toolkit is highly recommended by me.  It is available from EduCalc.

Scott.
sburke@jarthur.claremont.edu

rrd@hpfcso.FC.HP.COM (Ray Depew) (02/22/91)

In comp.sys.handhelds.and.hp.and.everybody.else,
 kenr@peabody.iusb.indiana.edu (Ken Rawlings) asks:

>I have a few questions that have been bugging me for a while:

>#1: It is possible to specify a custom menu in the solver(and the MES for
>that matter). However, I can not seem to be able to get "NXEQ" to work as
>a menu option. 

I agree with you; I think you're stuck with writing your own version of "NXEQ"
and putting it in your custom menu.  Fortunately, it's easy to write, quick,
and small.  Or, you might consider the idea given below.

>... Also, I cannot seem to make
>more that one custom menu per EQ.

What about making a custom menu for each equation named in your .EQ list?
Here's an example:

  { 'A+B=C' { B } }         store in ABC.EQ

  { 'D+E=F' { D } }         store in DEF.EQ

  { ABC.EQ DEF.EQ }         store in EQ

Now, when you enter the Solver, you see:

  ABC.EQ { 'A+B=C' { B...
  4:
  3:
  2:
  1:
  B   EXPR=  __ __ __ NXEQ    <----( the HP one!)

If you press NXEQ, you see:

  DEF.EQ { 'D+E=F' { D...
  4:
  3:
  2:
  1:
  D   EXPR=  __ __ __ NXEQ

>However, if I try to put more that one custom menu _anywhere_ in the
>EQ list, I get an error message. 

That's to be expected; the 48 sees a custom menu where it's expecting an
equation.  See above for a possible workaround.

>#2: What is the easiest way to subtract an atom from a list. i.e.
>
>	{ FOO BAR NETA }
>	- { NETA }
>       ------------------
>	= { FOO BAR}	
>
[ vi deleted this line for me, and I didn't hit "u" fast enough...]
>...common thing to do that it must already be built in somewhere.

It's in Jim Donnelly's Toolkit, if you have access to it.  I highly recommend
it.  

----------

Regards
Ray Depew
IC's by Bill and Dave   
rrd@hpfitst1.hp.com