To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
In the languages we’ve examined so far, when we have a high-level problem like “see if a list contains an interesting element,” we can define a high-level, problem-specific function like exists?. But we can’t yet define problem-specific data; no matter what problem we’re working on, our code is written in terms of representations like numbers, symbols, Booleans, lists, S-expressions, and constructed data. We should hope for better; if we’re implementing high-level actions like “find the rule in the table,” “multiply two 50-digit numbers,” or “stop recording when the event is over,” then our code should be written in terms of abstractions like tables, large numbers, and events. Such abstractions can be defined by the language features described in the last two chapters of this book.
A running μScheme program continually allocates fresh locations. How are they supplied? Memory is limited, and malloc will eventually run out. Memory can be recovered using free, but if a programmer must call free, as in C and C++, they risk memory errors: leaks, locations that are freed multiple times, and misuse of freed locations (so-called dangling-pointer errors). Memory errors can make a program crash—or, worse, silently produce wrong answers. But in languages like μScheme, full Scheme, Java, and JavaScript, which are memory-safe, such errors are impossible. The errors are prevented because the implementation of μScheme, not the μScheme programmer, figures out when it is safe to reuse a location. The techniques used to reuse locations safely are demonstrated in this chapter.
The languages of the preceding chapters, Impcore and μScheme, are dynamically typed, which is to say that many faults, such as applying a function to the wrong number of arguments, adding non-numbers, or applying car to a symbol, are not detected until run time. Dynamically typed languages are very flexible, but on any given execution, a fault might surprise you; even a simple mistake like typing cdr when you meant car might not have been detected on previous runs. And using cdr instead of car doesn’t cause a fault right away: cdr simply returns a list in a context where you were expecting an element. But if, for example, you then try to add 1 to the result of applying cdr, that is a checked run-time error: adding 1 to a list instead of a number. To rule out such errors at compile time, without having to run the faulty code, a programming language can use static typing.
The interpreters in Chapters 1 to 4 are written in C, which has much to recommend it: C is relatively small and simple; it is widely known and widely supported; its perspicuous cost model makes it is easy to discover what is happening at the machine level; and it provides pointer arithmetic, which makes it a fine language in which to write a garbage collector. But for implementing more complicated or ambitious languages, C is less than ideal. In this and succeeding chapters, I therefore present interpreters written in the functional language Standard ML.
Typed Impcore and Typed ρScheme represent two extremes. Typed Impcore is easy to program in and easy to write a type checker for, but because it is monomorphic, it cannot accept polymorphic functions, and it can accommodate new type constructors and polymorphic operations only if its syntax and type checker are extended. Typed μScheme is also easy to write a type checker for, and as a polymorphic language, it can accept polymorphic functions, and it can accommodate new type constructors and polymorphic functions with no change to its syntax or its type checker. But Typed μScheme is difficult to program in: as Milner observed, supplying a type parameter at every use of every polymorphic value soon becomes intolerable. To combine the expressive power of polymorphism with great ease of programming, this chapter presents a third point in the design space: nano-ML. Nano-ML is expressive, easy to extend, and also easy to program in. This ease of use is delivered by a new typing algorithm: instead of type checking, nano-ML uses type inference.
presents applicative programming in μScheme. But μScheme doesn’t just support applicative programming; it also supports the procedural programming style described in . In particular, it provides while, set, and begin. In the procedural style, while and if account for most control flow. But loops typically also use such control operators as break, continue, and return.
This book is about programming languages—and also about programming. Eachof these things is made better by the other. If you program but you don’t know about programming languages, your code may be longer, uglier, less robust, and harder to debug than it could be. If you know about programming languages but you don’t program, what is your knowledge for? To know a language is good, but to use it well is better.
Gripper is one of the most important parts of robot because of contacting with workpieces directly and has attracted lots of research interests. However, the existing grippers are either simple in function or complex in structure. In this paper, we will propose a one-DOF gripper based on a compliant mechanism with four identical twofold-symmetric Bricard linkages. A mobile network with four identical twofold-symmetric Bricard linkages with particular design parameters is constructed at first. Kinematics, such as mobility, singularity, and folding performance, is then analyzed to show the potential of realizing the function of grasping. The result is demonstrated with a physical prototype. To simplify the fabricating process, a compliant mechanism of the network is designed and fabricated with a single polypropylene board, and the grasping function is realized by a cable-driven scheme. Some grasping experiments are carried out on different types of objects which shows that the proposed and fabricated four-figure gripper is simple in structure and has a great grasping function. The work provides a new idea for the design of grippers with low cost, simple structure, and rich functions.
This study investigates the communication strategy (CS) use of English as a foreign language (EFL) learners in videoconferencing (VC), virtual world (VW), and face-to-face environments. The study was conducted with 30 senior Turkish undergraduate EFL students. The data were collected via video and audio recordings of three opinion-exchange tasks, a background and post-task questionnaire, and an interview that includes a retrospective think-aloud protocol. The participants worked in groups of five to complete the opinion-exchange tasks in each of the three environments. The findings indicated that the participants made use of a wide range of CSs, and although some of the CSs differed, mostly the same types were employed in all the environments. However, the results revealed that the frequency of CSs showed variance among environments, with the highest number in the VC environment and the lowest in the VW. It was possible to establish a connection between the differences in the frequency and the types of strategy use with the distinctive features of the environments, the proficiency level of the participants, and the type of the tasks that was utilized. Additively, 10 new strategy types were discovered.
Fake news detection is an emerging topic that has attracted a lot of attention among researchers and in the industry. This paper focuses on fake news detection as a text classification problem: on the basis of five publicly available corpora with documents labeled as true or fake, the task was to automatically distinguish both classes without relying on fact-checking. The aim of our research was to test the feasibility of a universal model: one that produces satisfactory results on all data sets tested in our article. We attempted to do so by training a set of classification models on one collection and testing them on another. As it turned out, this resulted in a sharp performance degradation. Therefore, this paper focuses on finding the most effective approach to utilizing information in a transferable manner. We examined a variety of methods: feature selection, machine learning approaches to data set shift (instance re-weighting and projection-based), and deep learning approaches based on domain transfer. These methods were applied to various feature spaces: linguistic and psycholinguistic, embeddings obtained from the Universal Sentence Encoder, and GloVe embeddings. A detailed analysis showed that some combinations of these methods and selected feature spaces bring significant improvements. When using linguistic data, feature selection yielded the best overall mean improvement (across all train-test pairs) of 4%. Among the domain adaptation methods, the greatest improvement of 3% was achieved by subspace alignment.
In this paper, a hydraulic soft gripper for underwater applications is designed to provide a solution for improving the gripping force as well as the sensing capability of the soft gripper. The soft gripper is made of silicone and has an integrated semi-circular hydraulic network inside. To enhance the rigidity and grasping performance of the soft gripper, we have integrated a restriction layer consisting of a spring steel plate in the soft gripper. Meanwhile, to enhance the sensing capability of this soft gripper, we have designed a water pressure sensor based on resistance strain gauges and integrated it on the spring steel plate. Before fabrication, we determined the structural parameters of the soft gripper by geometric analysis. Then we experimentally evaluated its pressure-bearing capacity, bending performance, the role of spring steel plates, and the accuracy of the sensor.The experimental results show that the spring steel plate improves the gripping force of the soft gripper, the sensor also has high accuracy, and the built four-finger gripping system has good adaptability to objects of different shapes and weights.Compared with the existing solutions, this solution takes a simpler structural form while improving the gripping force and sensing ability of the soft gripper, and integrates the issues of improving the gripping force and sensing ability. The spring steel plate used in this paper not only improves the gripping force of the soft gripper but also provides a stable and reliable platform for installing sensors.