I'm not quite certain about Scheme syntax. So L-free-particle is a
function accepting one argument "mass" that returns another function
accepting an argument "local"? And you are renaming "local" to
"tuple"? (I would have gone with "loc".)

What do you mean by "constructor for symbolic manipulation"? Julia
does support symbolic manipulation; this is e.g. used in macros, and
there is a class "Expr" that holds unevaluated expressions. However,
there are no built-in functions in Julia e.g. for differentiation or
simplification of such expressions as you would find in a computer
algebra system. Do SCMUTILS provide these?

Let me take a wild guess: The function q assembles a tuple consisting
of three functions. These functions are known by their names, but
their definitions may not be available yet. This would read the
following way in Julia:

```
q = quote (x,y,z) end
```
or in a more concise notation
```
q = :(x,y,z)
```

Later, in an environment where x, y, and z are defined, you can
"eval(q)", as in "eval(q)[1](value)", which would be equivalent to
"x(value)".

-erik



On Fri, Oct 10, 2014 at 9:32 AM, Amuthan A. Ramabathiran
<[email protected]> wrote:
> Any updates on this?
>
> Amuthan
>
> On Tuesday, January 14, 2014 3:31:16 PM UTC-8, Brian Cohen wrote:
>>
>> Most code examples for Julia are aimed at users of existing statistical
>> and numerical software without demonstrating how functional programming can
>> be substantially more useful for their field. In many ways, Julia is a Lisp
>> without S-Expressions, so I didn't think it would be unwise to port code
>> examples from Structure and Interpretation of Classical Mechanics from
>> Scheme to Julia. This book shows how functional programming can be directly
>> applied to the formalism of Lagrangian and Hamiltonian Mechanics, but Scheme
>> & SCMUtils may be too obscure and syntactically different from what people
>> are used to for most people in the physical sciences.
>>
>> Book review: http://www.ids.ias.edu/~piet/publ/other/sicm.html
>>
>> I was impatient, and decided to just start porting code, so the first
>> example was easy enough:
>>
>> (define ((L-free-particle mass) local)
>>   (let ((v (velocity local)))
>>   (* 1/2 mass (dot-product v v))))
>>
>> would become something like lFreeParticle(mass) = tuple -> begin v =
>> velocity(tuple); mass * dot(v,v) / 2 end. So far so good.
>>
>> But it's not long that I encounter usage of SCMUTILS
>>
>> (define q
>>   (up (literal-function 'x)
>>       (literal-function 'y)
>>       (literal-function 'z)))
>>
>> So I turn to the Appendix which talks about Symbolic values in Scheme, and
>> confirming it in the SCMUTILS documentation, it appears that symbols have
>> the same type as real numbers, which seems very different than symbolic
>> expressions as described in the Julia documentation. Here, up constructs a
>> tuple, and literal-function is a constructor for symbolic manipulation. At
>> this point, I'm not sure how to proceed, but am still looking into the
>> matter. I see that the only packages that mention symbolic manipulation are
>> a SymPy interface and a Calculus package.



-- 
Erik Schnetter <[email protected]>
http://www.perimeterinstitute.ca/personal/eschnetter/

Reply via email to