Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
2 answers
199 views

Generating a list (or a string) with random elements

During implementation and testing of different small hobby projects I often reach the point where I need (at least I like it more) some random data beyond the usual foo-bar strings or lists. Random ...
Martin Buchmann's user avatar
3 votes
2 answers
904 views

Reading lines of integers into a list of lists

I have a text file containing integers in different lines which I want to read into a list of lists. So 01 11 14 45 50 09 should become ...
Martin Buchmann's user avatar
3 votes
1 answer
58 views

Determine indentation of a line of code

The following function determines the amount of indentation of a string. It returns two values. The first is an effective indentation where tabs are expanded such that their end aligns with 4 spaces ...
Philipp Matthias Schäfer's user avatar
6 votes
1 answer
94 views

Finding capitalized characters and printing their position & ASCII value

I was trying to find out if a string contained a capitalized letter and if it did I wanted to know the position of the character and its ASCII code. I might have refactored a little to much. Given an ...
Cody's user avatar
  • 85
4 votes
2 answers
894 views

Creating a repetitive string in Common Lisp

I needed to have a Lisp function that could produce a string of a certain length, created by repeated concatenations of a another string given as argument (so for example by giving 10 and "abc" I ...
Wojciech Gac's user avatar
2 votes
1 answer
846 views

LISP - Modify string

I have to write a program that changes a string's vowels, consonants and other symbols into C, V respectively 0. I've done this but I wonder if there is a more efficient and elegant way to do it. ...
Max Bummer's user avatar
2 votes
1 answer
345 views

Abstract the (duplicate?) behavior between "sort" and "replace"

I have written these two functions that have a similar process. The first is meant to "split" a string on a given character and the second is meant to "replace-all" instances of a character in a ...
jaresty's user avatar
  • 2,283
4 votes
2 answers
3k views

Print an integer and its digits reversed

This Common Lisp program is an exercise to print an integer and its digits reversed to the screen: ...
jaresty's user avatar
  • 2,283