Compare commits

...
Author SHA1 Message Date
hypnotoad 5f97d7b893 Bringing vexpr up to date with the latest trunk.
Combining the vexpr patch with my fix to the m4 files that seek
out a native tcl8.6 binary and prefer it to tcl8.5 in the operating system.
(Several build scripts in the documentation for trunk now are using
8.6ism.)
2013-04-29 12:34:21 +00:00
hypnotoad be2e59e868 Bringing patch up to date with the latest trunk 2013-04-29 12:31:11 +00:00
seandeelywoods a0e4e2d38c Merging with updates from trunk 2013-03-18 12:38:37 +00:00
seandeelywoods e2fbcffaf9 Updating with latest fixes from trunk 2013-03-18 12:37:23 +00:00
seandeelywoods 8829bde510 Merging in changes from TRUNK 2013-01-19 17:02:59 +00:00
seandeelywoods ca697ffed8 Merging vexpr branch back to trunk 2013-01-07 10:07:44 +00:00
seandeelywoods a9f752bc41 Merging in changes from trunk 2012-12-20 10:04:48 +00:00
seandeelywoods 695b8ab52b Merging with trunk 2012-12-20 09:56:52 +00:00
seandeelywoods 6bb8c2c4f3 Modification to Autoconf to prefer tcl8.6+ or tcl9 over tcl8.5 (or older)
This allows build scripts that depend on new function in 8.6 to know
that the best native tclsh was detected and used by ./configure
2012-11-22 15:14:55 +00:00
hypnotoad 889e853bc9 Adding:
* generic/tclVexpr.tcl - Script to build tclVexpr.c and vexpr.n
  * generic/tclVexpr.c - File that implements the vexpr command
  * doc/vexpr.n - Manual for the vexpr command

Modified the build system to look for and build tclVexpr.c
2012-11-22 04:07:02 +00:00
11 changed files with 2833 additions and 11 deletions
+5 -1
View File
@@ -480,8 +480,12 @@
reverse mapping fails instead of falling back to the numeric
representation.
2012-11-20 Donal K. Fellows <dkf@users.sf.net>
2012-11-21 Sean Woods <yoda@etoyoc.com>
* Added generic/tclVexpr.c - Vector expression stack
* Added generic/tclVexpr.tcl - Script to regenerate generic/tclVexpr.c
* Added doc/vexpr.n - Manual for vexpr
2012-11-20 Donal K. Fellows <dkf@users.sf.net>
* generic/tclBinary.c (BinaryDecode64): [Bug 3033307]: Corrected
handling of trailing whitespace when decoding base64. Thanks to Anton
Kovalenko for reporting, and Andy Goth for the fix and tests.
+400
View File
@@ -0,0 +1,400 @@
.\"
.\" Copyright (c) 2012 Sean Woods
.\"
.\" See the file "license.terms" for information on usage and redistribution
.\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
.\"
.so man.macros
.TH vexpr n 8.7 Tcl "Tcl Built-In Commands"
.BS
.\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
vexpr \- Vector Expression Evaluator
.SH SYNOPSIS
\fBvexpr \fIarg arg opcode \fR?\fIarg opcode...?\fR
.BE
.SH DESCRIPTION
.PP
Performs one of several vector operations, depending on the \fIopcode\fR.
Opcodes and arguments are evaluated using reverse-polish notation.
.
Example:
.CS
\fBvexpr {1 1 1} {2 2 2} +\fR
.CE
.PP
Will return \fB\{3.0 3.0 3.0}\fR.
.PP
.RE
The legal \fIopcode\fRs:
.TP
\fBaffine_identity\fR
.RS 1
Usage: \fBaffine_identity\fR
.RE
.RS 1
Result: AFFINE
.RE
.PP
.RS 1
Pushes an affine identity matrix onto the stack
.RE
.TP
\fBaffine_multiply\fR
.RS 1
Usage: \fIAFFINE AFFINE\fR \fBaffine_multiply\fR
.RE
.RS 1
Result: AFFINE
.RE
.PP
.RS 1
Muliply 2 4x4 matrices. Used to combine 2 affine transformations. Note: Some affine transformations need to be performed in a particular order to make sense.
.RE
.TP
\fBaffine_rotate\fR
.RS 1
Usage: \fIVECTOR\fR \fBaffine_rotate\fR
.RE
.RS 1
Result: AFFINE
.RE
.PP
.RS 1
Convert a rotation vector (X Y Z) into an affine transformation
.RE
.TP
\fBaffine_scale\fR
.RS 1
Usage: \fIVECTOR\fR \fBaffine_scale\fR
.RE
.RS 1
Result: AFFINE
.RE
.PP
.RS 1
Convert a scale vector (X Y Z) into an affine transformation
.RE
.TP
\fBaffine_translate\fR
.RS 1
Usage: \fIVECTOR\fR \fBaffine_translate\fR
.RE
.RS 1
Result: AFFINE
.RE
.PP
.RS 1
Convert a displacement vector (X Y Z) into an affine transformation
.RE
.TP
\fBcartesian_to_cylindrical\fR
.RS 1
Usage: \fIVECTOR\fR \fBcartesian_to_cylindrical\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a cartesian vector to cylindrical coordinates
.RE
.TP
\fBcartesian_to_spherical\fR
.RS 1
Usage: \fIVECTOR\fR \fBcartesian_to_spherical\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a cartesian vector to spherical vector
.RE
.TP
\fBcopy\fR
.RS 1
Usage: \fIANY\fR \fBcopy\fR
.RE
.RS 1
Result: ANY ANY
.RE
.PP
.RS 1
Place an additional copy of the top of the stack on the top of the stack
.RE
.TP
\fBcylindrical_to_cartesian\fR
.RS 1
Usage: \fIVECTOR\fR \fBcylindrical_to_cartesian\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a cylindrical vector to a cartesian vector
.RE
.TP
\fBcylindrical_to_degrees\fR
.RS 1
Usage: \fIVECTOR\fR \fBcylindrical_to_degrees\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a cylindrical vector in radians to a cylindrical vector in degrees
.RE
.TP
\fBcylindrical_to_radians\fR
.RS 1
Usage: \fIVECTOR\fR \fBcylindrical_to_radians\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a cylindrical vector in degrees to a cylindrical vector in radians
.RE
.TP
\fBdt_get\fR
.RS 1
Usage: \fBdt_get\fR
.RE
.RS 1
Result: SCALER
.RE
.PP
.RS 1
Pushes the stored value of dT into the stack
.RE
.TP
\fBdt_set\fR
.RS 1
Usage: \fISCALER\fR \fBdt_set\fR
.RE
.RS 1
Result: (None)
.RE
.PP
.RS 1
Stores a new value for dT
.RE
.TP
\fBdump\fR
.RS 1
Usage: \fIANY\fR \fBdump\fR
.RE
.RS 1
Result: (None)
.RE
.PP
.RS 1
Output the contents of the top of the stack to stdout
.RE
.TP
\fBload\fR
.RS 1
Usage: \fBload\fR
.RE
.RS 1
Result: ANY
.RE
.PP
.RS 1
Push a previosly stored value the top of the stack
.RE
.TP
\fBpi\fR
.RS 1
Usage: \fBpi\fR
.RE
.RS 1
Result: SCALER
.RE
.PP
.RS 1
Pushes the value of PI into the stack
.RE
.TP
\fBspherical_to_cartesian\fR
.RS 1
Usage: \fIVECTOR\fR \fBspherical_to_cartesian\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a spherical vector to a cartesian vector
.RE
.TP
\fBspherical_to_degrees\fR
.RS 1
Usage: \fIVECTOR\fR \fBspherical_to_degrees\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a spherical vector in radians to a spherical vector in degrees
.RE
.TP
\fBspherical_to_radians\fR
.RS 1
Usage: \fIVECTOR\fR \fBspherical_to_radians\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert a spherical vector in degrees to a spherical vector in radians
.RE
.TP
\fBstore\fR
.RS 1
Usage: \fIANY\fR \fBstore\fR
.RE
.RS 1
Result: ANY
.RE
.PP
.RS 1
Store the top of the stack internally for later use. The value stored remains at the top of the stack.
.RE
.TP
\fBto_degrees\fR
.RS 1
Usage: \fIVECTOR\fR \fBto_degrees\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert Radians to Degress
.RE
.TP
\fBto_radians\fR
.RS 1
Usage: \fIVECTOR\fR \fBto_radians\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Convert Degrees to Radians
.RE
.TP
\fBvector_add\fR
.RS 1
Usage: \fIVECTOR VECTOR\fR \fBvector_add\fR
.RE
.RS 1
Aliases: +
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Add Two Vectors
.RE
.TP
\fBvector_cross_product\fR
.RS 1
Usage: \fIVECTOR VECTOR\fR \fBvector_cross_product\fR
.RE
.RS 1
Aliases: *X
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Push the cross product of two vectors on the stack
.RE
.TP
\fBvector_dot_product\fR
.RS 1
Usage: \fIVECTOR VECTOR\fR \fBvector_dot_product\fR
.RE
.RS 1
Aliases: *.
.RE
.RS 1
Result: SCALER
.RE
.PP
.RS 1
Push the dot product of two vectors on the stack
.RE
.TP
\fBvector_length\fR
.RS 1
Usage: \fIVECTOR\fR \fBvector_length\fR
.RE
.RS 1
Result: SCALER
.RE
.PP
.RS 1
Convert a vector to it's length
.RE
.TP
\fBvector_scale\fR
.RS 1
Usage: \fIVECTOR SCALER\fR \fBvector_scale\fR
.RE
.RS 1
Aliases: *
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Scale a vector by a scaler
.RE
.TP
\fBvector_subtract\fR
.RS 1
Usage: \fIVECTOR VECTOR\fR \fBvector_subtract\fR
.RE
.RS 1
Aliases: -
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Subtract Two Vectors
.RE
.TP
\fBvector_transform_affine\fR
.RS 1
Usage: \fIAFFINE VECTOR\fR \fBvector_transform_affine\fR
.RE
.RS 1
Result: VECTOR
.RE
.PP
.RS 1
Transform a vector using an affine matrix
.RE
.SH "SEE ALSO"
expr(n)
.SH KEYWORDS
vector
+1
View File
@@ -252,6 +252,7 @@ static const CmdInfo builtInCmds[] = {
{"uplevel", Tcl_UplevelObjCmd, NULL, TclNRUplevelObjCmd, 1},
{"upvar", Tcl_UpvarObjCmd, TclCompileUpvarCmd, NULL, 1},
{"variable", Tcl_VariableObjCmd, TclCompileVariableCmd, NULL, 1},
{"vexpr", Tcl_VexprObjCmd, NULL, NULL, 1},
{"while", Tcl_WhileObjCmd, TclCompileWhileCmd, TclNRWhileObjCmd, 1},
{"yield", NULL, TclCompileYieldCmd, TclNRYieldObjCmd, 1},
{"yieldto", NULL, NULL, TclNRYieldToObjCmd, 1},
+3
View File
@@ -3405,6 +3405,9 @@ MODULE_SCOPE int Tcl_UpvarObjCmd(ClientData clientData,
MODULE_SCOPE int Tcl_VariableObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int Tcl_VexprObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int Tcl_VwaitObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
+1067
View File
File diff suppressed because it is too large Load Diff
+1245
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -307,7 +307,7 @@ GENERIC_OBJS = regcomp.o regexec.o regfree.o regerror.o tclAlloc.o \
tclStrToD.o tclThread.o \
tclThreadAlloc.o tclThreadJoin.o tclThreadStorage.o tclStubInit.o \
tclTimer.o tclTrace.o tclUtf.o tclUtil.o tclVar.o tclZlib.o \
tclTomMathInterface.o \
tclTomMathInterface.o tclVexpr.o \
tclAssembly.o
OO_OBJS = tclOO.o tclOOBasic.o tclOOCall.o tclOODefineCmds.o tclOOInfo.o \
@@ -454,6 +454,7 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tclTrace.c \
$(GENERIC_DIR)/tclUtil.c \
$(GENERIC_DIR)/tclVar.c \
$(GENERIC_DIR)/tclVexpr.c \
$(GENERIC_DIR)/tclAssembly.c \
$(GENERIC_DIR)/tclZlib.c
@@ -1304,6 +1305,9 @@ tclUtil.o: $(GENERIC_DIR)/tclUtil.c $(PARSEHDR)
tclUtf.o: $(GENERIC_DIR)/tclUtf.c $(GENERIC_DIR)/tclUniData.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtf.c
tclVexpr.o: $(GENERIC_DIR)/tclVexpr.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclVexpr.c
tclVar.o: $(GENERIC_DIR)/tclVar.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclVar.c
+54 -5
View File
@@ -449,11 +449,44 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
AC_DEFUN([SC_PROG_TCLSH], [
AC_MSG_CHECKING([for tclsh])
AC_CACHE_VAL(ac_cv_path_tclsh, [
search_path=`echo ${PATH} | sed -e 's/:/ /g'`
for dir in $search_path ; do
for j in `ls -r $dir/tclsh[[8-9]]* 2> /dev/null` \
`ls -r $dir/tclsh* 2> /dev/null` ; do
# Attempt to find Tcl8.6
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh8[[6-9]] 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
break
fi
fi
done
done
if test -e "$ac_cv_path_tclsh" ; then
# Attempt to find Tcl9+ or later
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh9* 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
break
fi
fi
done
done
fi
if test -e "$ac_cv_path_tclsh" ; then
# Attempt to find any tclsh8.5 on the system
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh8[[5-9]] 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
@@ -461,12 +494,28 @@ AC_DEFUN([SC_PROG_TCLSH], [
fi
fi
done
done
done
fi
if test -e "$ac_cv_path_tclsh" ; then
# Attempt to find any tclsh on the system
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh* 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
break
fi
fi
done
done
fi
])
if test -f "$ac_cv_path_tclsh" ; then
TCLSH_PROG="$ac_cv_path_tclsh"
AC_MSG_RESULT([$TCLSH_PROG])
AC_MSG_RESULT($TCLSH_PROG)
else
# It is not an error if an installed version of Tcl can't be located.
TCLSH_PROG=""
+1
View File
@@ -259,6 +259,7 @@ TCLOBJS = \
$(TMPDIR)\tclUtf.obj \
$(TMPDIR)\tclUtil.obj \
$(TMPDIR)\tclVar.obj \
$(TMPDIR)\tclVexpr.obj \
$(TMPDIR)\tclWin32Dll.obj \
$(TMPDIR)\tclWinChan.obj \
$(TMPDIR)\tclWinConsole.obj \
+1
View File
@@ -341,6 +341,7 @@ COREOBJS = \
$(TMP_DIR)\tclUtf.obj \
$(TMP_DIR)\tclUtil.obj \
$(TMP_DIR)\tclVar.obj \
$(TMP_DIR)\tclVexpr.obj \
$(TMP_DIR)\tclZlib.obj
ZLIBOBJS = \
+51 -4
View File
@@ -1156,9 +1156,40 @@ AC_DEFUN([SC_PROG_TCLSH], [
AC_CACHE_VAL(ac_cv_path_tclsh, [
search_path=`echo ${PATH} | sed -e 's/:/ /g'`
for dir in $search_path ; do
for j in `ls -r $dir/tclsh[[8-9]]*.exe 2> /dev/null` \
`ls -r $dir/tclsh* 2> /dev/null` ; do
# Attempt to find Tcl8.6
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh8[[6-9]]*.exe 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
break
fi
fi
done
done
if test -e "$ac_cv_path_tclsh" ; then
# Attempt to find Tcl9+ or later
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh9*.exe 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
break
fi
fi
done
done
fi
if test -e "$ac_cv_path_tclsh" ; then
# Attempt to find any tclsh8.5 on the system
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh8[[5-9]]*.exe 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
@@ -1166,7 +1197,23 @@ AC_DEFUN([SC_PROG_TCLSH], [
fi
fi
done
done
done
fi
if test -e "$ac_cv_path_tclsh" ; then
# Attempt to find any tclsh on the system
for dir in $search_path ; do
for j in \
`ls -r $dir/tclsh* 2> /dev/null` \
; do
if test x"$ac_cv_path_tclsh" = x ; then
if test -f "$j" ; then
ac_cv_path_tclsh=$j
break
fi
fi
done
done
fi
])
if test -f "$ac_cv_path_tclsh" ; then