Questions tagged [s-expression]

S-expressions are a notation for nested list or tree-structured data, popularized by the Lisp programming language.

In computing, s-expressions, sexprs or sexps (for "symbolic expression") are a notation for nested list (tree-structured) data, invented for and popularized by the programming language which uses them for source code as well as data.

Source: Wikipedia

138 questions
0
votes
2 answers

Parse string with "read" and ignore package namespaces

I am writing a program that opens a lisp file, calls "read" on the stream until the stream is empty, and does things with the lists it collects. This was working quite nicely until I discovered that "read" will perform package lookup, for instance…
0
votes
0 answers

Racket - Eval S-Expressions

A S-Expression is considered as a Number, a String, a Symbol, a Bool, an Image, empty or a List-of S-Expressions. How do I achieve to make racket eval my S-Expression? '(1 2 (+ 2 1))) should yield (list 1 2 3). I want to do this with Beginning…
HappyR
  • 23
  • 3
0
votes
1 answer

Example input and output for Racket

I don't want help solving this question however I would like to know exactly what it's asking for. And in order to better understand what it's asking for I'm asking if anyone could provide me with an example input and its corresponding output. Write…
Will
  • 143
  • 2
  • 13
0
votes
4 answers

Parsing s-expressions with PHP

Well, I need to parse 2 textfiles. 1 named Item.txt and one named Message.txt They are configuration files for a game server, Item contains a line for each item in the game, and Message has Item names, descriptions, server messages etc. I know this…
Zen
  • 7,197
  • 8
  • 35
  • 57
0
votes
0 answers

How to make a tex-like typesetting engine

Because of the complexity of (LaTex), I recently think of a idea that using a scheme (or S-expression) like language to make a article/book/etc, and make a typesetting engine that can convert the format to pdf. However, which of the library should I…
0
votes
1 answer

Construct binary tree from s-expression in c++

empty tree ::= () tree ::= empty tree | (w tree tree) ex: () empty tree (99(5()())(35(-5()())())) 99 / \ 5 35 / -5 class Node { public: int weight; // weight can be negative! Node *left, *right; …
jasmine
  • 13
  • 1
  • 3
0
votes
0 answers

Parsing a complex tree structured file in c#

I'm tring to build up a parser reading a tree strutured file format that we are using in c# in order to modify it with a VSTO Excel interface. (Hence the C# choose otherwise I would have used Python beeing a beginer in C#...) The format is defined…
0
votes
2 answers

Splitting Lisp expression in java

Ok, so the assignment is that I take the Lisp expression: '(A B C D) And turn it into '(D C B A) in Java. To do this, I have this code: String[] items = input.split(" |\\(|\\)|'"); int y = 0; for (String x : items){ //this part is purely for…
0
votes
0 answers

How do I find the position of a linked s-expression from the original string it was parsed from?

I've been reading through the sexp.h file reference in an attempt to generate helpful errors when parsing a lisp-like sequence fails because an operator or operand was not formatted as expected. I am currently using the cparse_sexp function to parse…
quant
  • 21,507
  • 32
  • 115
  • 211
0
votes
4 answers

parsing keyed lists from a file in tcl?

I have a file full of records in the following format: {TOKEN { NAME {name of this token} } { GROUPS {Group 1} } { VALUE value } { REPEATING { { MAX 3 } { TIME {nmin 30} } } } { WINDOW */*/*/* } { ACTION…
jenny lynne
  • 1
  • 2
  • 8
0
votes
1 answer

(Unbound variable) Use functions on a list of S-Expressions (mit-scheme)

I am trying to use a function on a list of S-expressions, but it just gives me an error "Unbound variable butter". (depth* (() ((bitter butter) (makes) (butter bitter) butter)))
luojiebin
  • 103
  • 2
  • 3
  • 14
0
votes
2 answers

Are there any other S-exp based languages apart from the Lisp dialects?

Are there any other S-expression or polish prefix notation based languages apart from the Lisp dialects? It doesn't have to be a functional programming language or be related in some way to Lisp. When I say Lisp dialects, I mean Arc, AutoLISP,…
ruben2020
  • 1,549
  • 14
  • 24
0
votes
1 answer

What is the meaning of symbols in PexSymbolicValue.GetRawPathConditionString()?

I'm using PexSymbolicValue.GetPathConditionString() to get path condition within PexMethods. I found there is a method PexSymbolicValue.GetRawPathConditionString() that get the path conditions in S-expression format but I can't find a reference of…
Ebeid ElSayed
  • 1,126
  • 2
  • 15
  • 32
0
votes
1 answer

Java LISP implementation almost working

package PJ2; import java.util.*; public class SimpleLispExpressionEvaluator { // Current input Lisp expression private String inputExpr; // Main expression stack & current operation stack, see algorithm in evaluate() private…
yoshi105
  • 41
  • 2
  • 6
-1
votes
1 answer

How to convert s-expression which is in string into a tuple in Python

I have an S-expression in Python which I need to convert it into tuple with operators (add,multiply) inside the semi-colon ie as a string. I have the following code snippet: This code works fine, but the requirement of the work is that the user…
Reactoo
  • 916
  • 2
  • 12
  • 40
1 2 3
9
10